You are viewing a single comment's thread from:

RE: Tutorial (Godot Engine v3 - GDScript) - GUI for score & lives!

in #utopian-io6 years ago

Wow! Thanks Wolf for taking the time to provide the response! I can understand from the above a reason to use Control. My need was only for a parent container for the TitleValues. I wasn't looking to try to find the perfect answer :-). My concern is that worrying to such low detail is expending energy on something that makes no real impact on the final delivery. IF I worried about every little aspect like this, I'd never write code; I don't want to sound arrogant or flippant; what I'm trying to say is, YES, you are correct. If I were building a large GUI will buttons and controls, then using the Control as a parent would make more sense. However, it is just a simple container to hang the TitleValue's of. I'll happily change it to control now, going forward, but in the scheme of things, it isn't important.

In fact, I've just changed the node to Control; this then breaks the game.

Control doesn't have all the positioning on the screen, i.e. Z-Index. Therefore I now would have to create a Canvas too and then set priorites; but with that, I lose visibility!

Sort:  

Yeah, takes some fiddling to get stuff to work right. Appreciate your responses, I never really understood how Godot handles is beyond a "it just works" explanation.

Why I resorted to writing some scenarios and try to explain the thinking because it is this experience that I think is invaluable to a learner. I really love Godot and the way it is designed for scripting etc, but it can be frustrating too, when you know you want something simple, but have to bend and shape as you require. I.E. The physics engine in is great, but it has so many unresolved issues because it is trying to be general to all, but is actually specific to its implementation (if you know what I mean)

Hey @sp33dy I thought I'd share this. The camera in this game moves, so using a canvas layer is a necessity. I found this method simple for hiding unnesacary nodes for the scene and keep it simple and clean. All you need to do is save your canvas layer as a packed scene.

Screenshot (19).png

@Wolfwin, I was meant to respond to you. I do like the idea of saving the packed scene, but it still didn't provide a way for me to hide the UI via the visible flag. Thanks for the heads-up.

Coin Marketplace

STEEM 0.22
TRX 0.12
JST 0.029
BTC 66433.10
ETH 3607.66
USDT 1.00
SBD 2.69