Shaking dialog and UI text

Discussion and feedback on Construct 2

Post » Tue Jul 21, 2015 1:17 pm

I tried searching for this but couldn't find anything in the forums about it. Thanks in advance for any help!

I'm having a problem where my text dialog and UI shakes when my hero is moving.

I'm setting the position of the speech bubble and the position of the next in the same event and doing it every tick. My text is a Sprite Font object and I'm setting it's position to an image point on the speech bubble, which is being set to an image point on the player sprite.

You can't see my UI in the GIF, but it's simply anchored to the top right using the behavior, and it shakes as well when the camera moves.

Image
B
9
S
1
G
2
Posts: 32
Reputation: 1,974

Post » Tue Jul 21, 2015 2:45 pm

You could put the UI on a layer that has parallax set to 0, 0? That way it's x, y coordinates always stay the same (unless you need to have the UI in areas related to the layout, but I prefer the 0 parallax method)

As far as the text, you could probably just use a pin behavior and pin it to the speech bubble itself.
B
37
S
5
G
1
Posts: 155
Reputation: 2,140

Post » Tue Jul 21, 2015 3:06 pm

Thanks @blekdar, I'll give both of those a try!
B
9
S
1
G
2
Posts: 32
Reputation: 1,974

Post » Tue Jul 21, 2015 5:07 pm

I had similar trouble when I was pinning objects to something else that was then pinned to a different object. The only way I could get rid of the lag was to pin everything to the same top level object. So if you are setting the bubble to the player position, then setting the text to the bubble location - try setting the text to an offset of the same player coordinates that you are setting the bubble to. That way it can't be a frame behind.
B
98
S
35
G
20
Posts: 438
Reputation: 17,875

Post » Tue Jul 21, 2015 6:42 pm

I quickly tried setting the UI layer parallax to 0,0 which worked like a charm. Thanks!

I've not tried using the pin behavior on the Sprite Font, but it sounds promising. Thanks @blekdar and @AllanR.
B
9
S
1
G
2
Posts: 32
Reputation: 1,974

Post » Wed Jul 22, 2015 1:27 pm

Pining the object to the player worked!

But, now I'll need to set multiple image points on the player for different text alignments (and I'll also need to adjust the text for when the sprite is flipped so it doesn't appear outside the bubble. That's two image points for each dialog alignment!), so unfortunately it's a little more work than I would like. I still don't fully understand why pining it to the speech bubble caused the lag and I have to think that's a bug. But maybe something is just going over my head?

As you can see in my GIF, I'm still working on getting the text position to be right all the time, but it no longer jitters.

Image
B
9
S
1
G
2
Posts: 32
Reputation: 1,974


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests