[Solved] Layout and preview are different - why?

i am playing around with the template “ping pong”.
i added a text on the screen.
one on the left side (player 1). one on the right side (player 2).
but:
the preview is showing the right side text (player 2) in the wrong position.
why?


Because the objects are moved due to the anchor behavior. You can click on the score and see in the behavior tab how they are configured.

1 Like

its not the score, its the text which has the wrong position.

Hello, designpeter

Are your two text objects on the same layer?

hello rasterisko,
yes they are.
and very mysteriuos; textposition on the left side is alwasy ok. right side is always wrong…
have a look on the gdevelop template “ping pong”.
you can reproduce this (bug?): place a textsprite on the right side of the screen and see what happens…
???

I did the test here and Bouh is right. Player_2_Score anchor behavior is changing its position according to window size. Preview it and start changing the size of the window and you’ll see.

About the Anchor Behavior wiki says:

“You can anchor an object to the screen by using anchor behavior to pin its edges (bottom, left, right, or top) to the window edges. Once anchored, if the screen size changes, the distance between the edge of the object and the edge of the window will stay the same. This is useful for static UI/HUD objects.”

2 Likes

oh yes . thank you very much. now i saw it.
its a fullscreen “problem”.
but where can i find these “anchor” settings?
???

oh , i found the anchor settings.
now i learned a gain something new.
thanks again to all who helped.
and thanks for your patience!!!

1 Like