Constructor
new State(element, headlessopt)
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
element |
Element | The element underpinning the associated Region. | ||
headless |
boolean |
<optional> |
false
|
Whether westures is operating in "headless" mode. |
Members
active :Array.<westures-core.Input>
- Description:
- The array of currently active inputs, sourced from the current Input objects. "Active" is defined as not being in the 'end' phase.
- Source:
The array of currently active inputs, sourced from the current Input
objects. "Active" is defined as not being in the 'end' phase.
Type:
- Array.<westures-core.Input>
activePoints :Array.<westures-core.Point2D>
- Description:
- The array of latest point data for the currently active inputs, sourced from this.active.
- Source:
The array of latest point data for the currently active inputs, sourced
from this.active.
Type:
- Array.<westures-core.Point2D>
centroid :westures-core.Point2D
- Description:
- The centroid of the currently active points.
- Source:
The centroid of the currently active points.
Type:
element :Element
- Description:
- Keep a reference to the element for the associated region.
- Source:
Keep a reference to the element for the associated region.
Type:
- Element
event :Event
- Description:
- The latest event that the state processed.
- Source:
The latest event that the state processed.
Type:
- Event
headless :boolean
- Description:
- Whether westures is operating in "headless" mode.
- Source:
Whether westures is operating in "headless" mode.
Type:
- boolean
inputs :Array.<westures-core.Input>
- Description:
- All currently valid inputs, including those that have ended.
- Source:
All currently valid inputs, including those that have ended.
Type:
- Array.<westures-core.Input>
Methods
clearEndedInputs()
- Description:
- Deletes all inputs that are in the 'end' phase.
- Source:
getInputsInPhase(phase) → {Array.<westures-core.Input>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
phase |
string | One of 'start', 'move', 'end', or 'cancel'. |
Returns:
Inputs in the given phase.
- Type
- Array.<westures-core.Input>
getInputsNotInPhase(phase) → {Array.<westures-core.Input>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
phase |
string | One of 'start', 'move', 'end', or 'cancel'. |
Returns:
Inputs not in the given phase.
- Type
- Array.<westures-core.Input>
hasNoInputs() → {boolean}
- Source:
Returns:
True if there are no active inputs. False otherwise.
- Type
- boolean