Add 1 thing: this is a browser game so Anchor not work good
I’m trying to place a button on the game scene. I created the button at the start of the game scene, but I also tried creating it through the visual editor, and the result didn’t change. I created an event with no conditions where I set the width = SceneWindowWidth()
and height = SceneWindowHeight()
.
Then, I created a condition that says if the width is greater than the height, place the button at the new position. If the height is greater than the width, place it in a different position (in this example, it’s the same position).
I also tried placing the button position in the “Always” event, but nothing changes.
I run the test on my phone, and in portrait, the button appears correctly. In landscape, it works fine the first time. After rotating to portrait, it’s correct, but when rotating back to landscape, the button appears roughly in the middle of the scene along the X-axis. Why is that happening?
My game is supposed to be developed in landscape.
Thanks,
Chiara