Changes a target's state based on pointer events (MouseEvent and
TouchEvent), like a button.
1.0.0
.See:
feathers.utils.KeyToState
Constructor
new (?target:InteractiveObject, ?callback:T ‑> Void, upState:T, downState:T, hoverState:T)
Creates a new PointerToState object with the given arguments.
1.0.0
.Variables
read onlycurrentState:T
The current state of the utility. May be different than the state of the target.
1.0.0
.enabled:Bool = true
May be set to false to disable the state changes temporarily until set
back to true.
1.0.0
.keepDownStateOnRollOut:Bool = false
If true, the current state will remain as downState until
MouseEvent.MOUSE_UP is dispatched. If false, and the pointer leaves
the bounds of the target after MouseEvent.MOUSE_DOWN, the current
state will change to upState.
1.0.0
.target:InteractiveObject = null
The target component that should change state based on pointer (mouse or touch) events.
1.0.0
.callback:T ‑> Void = null
The function to call when the state is changed.
The callback is expected to have the following signature:
String -> Void1.0.0
.