Skip to main content

Hiding

You can create a node, but keep it hidden.

You can set the hidden property on any node. If it is true, the node -- and all its children -- will not display.

Below, we create two labels, but you can see only one of them. The other label is hidden.

note

Why go through the trouble to create something but not show it? Later, we'll see it is useful to create a hidden node, but then "unhide it" in response to a user action.

Loading...
Explore:
  • If you set hidden: false (or remove the hidden property from invisibleLabel), it will appear.
  • If a parent has hidden: true, its children will also not appear -- even if you set hidden: false on the child. This code shows an empty scene.