Posted July 08, 2017 by Pigdev
#gamedev #godot engine #game design #gui #GUI #UI #game development
Godot Engine provides a built-in GUI system which can automatically rearrange, resize and rescale Control Nodes by using Container Nodes. We can have a lot of fun trying to understand them and how they work, especially by trial and error. But once you understand them you can do some neat interface behaviors.
In Moon Cheeser I decided to make a very simple GUI with only the most necessary items being displayed:
The first iteration of the concept led to a thoughtful discussion about how it would look in other resolutions and how I could handle that.
By studying how Containers work and what they are capable of, and also how Controls use anchors to rearrange and rescale the children nodes I came out with something that looked like a solution:
This is how I implemented it:
Then the other UI elements just need to check for this signal and do the proper behavior, for instance, that's what happens when the Node in charge of the left portion of the screen receives a signal and the resolution is equal or lower than a LOW resolution:
This is more or less the result I could reach with this technique. I still have to change some behaviors and make a mobile version, but I really liked it:
That's it, this is my report for this week's devlog. I hope you enjoyed! If you want to know more about it, check the Moon Cheeser wiki :>