First Iteration of GUI
Godot's GUI
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.
Moon Cheeser GUI Concept
In Moon Cheeser I decided to make a very simple GUI with only the most necessary items being displayed:
- An advertising button
- The Moon or the Game Title
- A button leading to the Achievements Screen, which also is the Skins Screen
- A sound slider to manage sound output
- Play and Credits buttons, which will lead to the respective screens
- Some language options to localization
Implementation
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:
- Use only Containers to automatically rearrange everything
- A Margin Container will control the rectangle which will constrain the elements inside it
- The Margin Container's size will always be the same of the game's window's size
- The Margin Container will emit a signal every time its size change, telling the current size
- By using the signal I can trigger the visibility of the other UI elements, hiding or showing them
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:
Result
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 :>
Get Moon Cheeser
Moon Cheeser
Is it possible that somewhere in the space there's a moon made out of cheese?
Status | Released |
Authors | Pigdev, Henrique Campos |
Genre | Action |
Tags | assets, Casual, Cute, flat-shading, godot-engine, infinite-runner, one-button, Singleplayer, Space, Vector |
Languages | English |
Accessibility | High-contrast, Interactive tutorial, Textless, One button |
More posts
- Manual is out!Nov 21, 2020
- Blue Moon update!Nov 02, 2020
- I miss manuals :(Oct 09, 2020
- Small fixes and additionsApr 05, 2019
- Moon Cheeser v2.0.0!!Apr 03, 2019
- SwingPivot: Procedural Swing AnimationMar 22, 2019
- Particles are back and better in v2.0.0Feb 28, 2019
- Making reusable AssetsFeb 27, 2019
- Refactoring on the Core Loop! Better Code Coming Soon!Feb 13, 2019
- Port to Godot 3.1Sep 18, 2018
Leave a comment
Log in with itch.io to leave a comment.