Is it possible to add a new node visibility property to the engine?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dariem

Is it possible that for the next version of GODOT, a visibility classification is added, which allows the object to remain in place with its size, and only the texture is not visible?

I suggest naming it “invisibility”.

I propose this because when using a grid container and hiding an object, the content moves to the empty column. This is the case with many other containers. This prevents certain animations and operations with the nodes. For example when displaying in a grid of 3 columns, 9 images, in random order. The result is a mess and they go out side by side and are sorted as they appear. This type of effect would like to do it, but the current visibility property does not allow it. Thanks in advance.

:bust_in_silhouette: Reply From: Zylann

There are several ways to workaround this:

    1. Make the control transparent by changing modulate to a transparent color, and change its mouse mode to ignore so it will not process mouse events
    1. Hide the contents of your control rather than the control itself. If not applicable, wrap your node within a basic Control, so the parent will remain visible and the child hidden. This will also allow you to animate the child freely, relative to the rectangle it should normally occupy.
    1. Write your own container. Much more work. I ended up doing that to animate my menu horizontally while still having my buttons auto-layout vertically.
    1. Search, or ask for a visibility-layout hint feature in Issues · godotengine/godot-proposals · GitHub, then wait for someone to do a PR, or code it yourself. That said, if you also want movement animation, option 2) or 3) already work better than a complex proposal.

The first way is probably the best way to do it :slight_smile:
When you set a node’s modulate alpha to 0, it won’t even be rendered. This improves performance.

Calinou | 2020-03-05 08:37