+1 vote

Godot has a bunch of stretch options for resizing/scaling the display as the window changes size or aspect ratio, but that seems to assume the game was designed with a fixed size in mind.

I would like to design a responsive game where a larger window/screen means you see more of the 2D world. I don't want the elements to actually get larger just because they have a larger monitor and I want to be able to anchor UI elements to the top and bottom of the screen.

It seems that in order to do this I have to disable the stretch modes and use anchors and such on UI controls, but then I run into a question of how to do things like present panels that slide up from the bottom or fly in with a nice animation. Is it possible to use the animator for this sort of thing? It seems like all of the control offsets are specified in pixels and that doesn't make sense when the size of the screen/viewport varies depending on the size of a person's window/monitor.

Does this mean that all such UI animations/presentations are likely to need to be done manually with code using tweens and scripts that calculate target positions based on the current window size? If so, how can I share this sort of presentation logic among multiple panels that come up with different types of actions? Do they have to share a common ancestor or something? If the window is resized after the tween has happened, how can I make sure it stays in the correct relative position on screen?

in Engine by (16 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.