Hi,
My game is published but i need fix somethings that i don't know the best practices to do it: https://flyforcoins.prsolucoes.com/
My GUI is following the viewport at any size. If i resize it follow TOP RIGHT anchor.
But my "game" or the "center of the game" or the "main part of the game" don't follow it and is always on position 0,0 with the initial viewport size (960 x 640). Example:
And i can create objects out of initial viewport, like the coins and enemies as you can see on screenshot. Im using this code to spawn things:
var spawn = coin25.instance()
var vp_size = get_node("/root/World").get_viewport_rect().size
var spawn_size = spawn.get_node("Sprite").frames.get_frame("normal", 0).get_size()
var pos_x = (spawn_size.y / 2) + vp_size.x
var pos_y = rand_range((spawn_size.y / 2), (vp_size.y - (spawn_size.y / 2)))
spawn.position = Vector2(pos_x, pos_y)
add_child(spawn)
It works very well.
The only problem is the game main part that don't follow the size of viewport. All other screens are very well positioned. Look:
This is very strange. Look at my scene to understand that i already put a physic body in control node and put the anchor to bottom left:
I don't know how can i solve it.
I put screenshots in desktop app only to simulate the problem. Because the only device that i really have problems is on iPad. On devices like iPhone, Android and Tablet with Android it works without this problem. And if i resize the screen i can simulate the problem.
Thanks.