Skip to content

Search

Documentation

states

Named looks for the node. Every key beside current and duration is a state holding per-component property tables; node.states.set_state(\"hover\") patches…

في هذه الصفحة

interaction · 2 properties · Other

Named looks for the node. Every key beside current and duration is a state holding per-component property tables; node.states.set_state("hover") patches one over the node.

In a scene, states is the node key that applies it. A script reaches each property below as a field on node.states: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.states.get() and node.states.set(table).

Properties

property type default description
current string — The state this node is in; empty is the pose the scene gave it
duration float 0 Seconds a transition takes; zero snaps At least 0.

Script functions

Methods of node.states, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().

From node:

method what it does
set_state() Put the node in one of its states: the state's table is patched over the components it names, and on_state_changed(from, to) follows. A node already in that state is left alone.
state() The state the node is in, or "" for the pose the scene gave it.