GUI behaviour requests from Family Age

Hello, there is list of our gui using expierence and some suggestions:

  1. Now: Changing parent of node in editor or in game changing this node positions.
    We changed parent at runtime, and it changed node’s position (unexpected for us). In editor it will be more comfortable, when changing parent nodes, dont drag nodes to their place back.

  2. For now there is 2 methods for get position: gui.get_position() and gui.get_screen_position().
    We want to have ability in one method get position on scene (sum of all positions node and his parents)

  3. For now gui.is_enabled() return if enabled node itself.
    We want to have ability calc enabled state of node in hierarchy with one method . If one of node’s parents is disabled - node disabled. gui.is_enabled_in_hierarchy() for example.
    issue here that node is not rendered, because its parent is disabled, but gui.is_enabled returns true. In is_enabled description it pointed that disabled nodes are not rendered nor animated.

  4. I have some discomfort with gui.clone_tree() when clonning gui templates. I got the table of nodes with names: [template_name/node_name]. Is there a way to get names without template_name prefix?

  5. We want to hide nodes in gui editor (already anounced this). And want to set start enabled/disabled state (+100 to comfort gui work) of gui nodes

  6. It will be nice to have ability to reset template gui state (reset all properties), but probably this feature double the node size? :slight_smile:

This is just our questions/suggestions. If you feel some (or all) of them are unreasonable, please explain why.

Have a good day © Family Age Team <3

3 Likes

This is exactly like parenting game objects. The world/screen position is the sum of the parent node/gos transforms. When parenting game objects there’s an option to keep the world transform. We could probably add the same when parenting nodes at run-time as an option to gui.set_parent(). In the editor perhaps while holding down a modifier key.

Ok, sure, I can see how that can be useful sometimes. I wonder what such a function should be named? gui.get_world_position() is not quite right since we’re in screen space. gui.get_scene_position()? gui.get_aggregated_position()? gui.get_global_position()?

I have a helper function in gooey that does this. I think we have this in our backlog somewhere to add.

2 Likes

Sorry if I’m hijacking the post, but what does gui.get_screen_position() do? It’s not clear from the docs (I clicked “Have a suggestion?” to report it).

1 Like

It returns the aggregated node position, adjusted for a scaled window.

2 Likes