Constructor
new SystemInput($parameters)
- Description:
- Creates a new input system.
- Source:
Example
const system = new SystemInput({$container});
system.initiate();
system.tick();
Parameters:
| Name | Type | Description |
|---|---|---|
$parameters |
object | The given parameters. |
$parameters.$container |
HTMLElement | The container on which to attach input events. |
Methods
getInput($input) → {boolean}
- Description:
- Gets the persisted status of the given input.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$input |
string | The event code of the input. |
Returns:
- Type
- boolean
getInputAnalog($input) → {number}
- Description:
- Gets the analog value of the given input.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$input |
string | The event code of the input. |
Returns:
- Type
- number
getInputDown($input) → {boolean}
- Description:
- Gets the initiated status of the given input.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$input |
string | The event code of the input. |
Returns:
- Type
- boolean
getInputUp($input) → {boolean}
- Description:
- Gets the terminated status of the given input.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$input |
string | The event code of the input. |
Returns:
- Type
- boolean
onInitiate()
- Description:
- Called when the system is being initiated.
- Source:
onTerminate() → {undefined|Promise.<void>}
- Description:
- Called when the system is being terminated.
- Source:
Returns:
- Type
- undefined | Promise.<void>
onTick($parameters)
- Description:
- Called when the system is being updated by one tick update.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$parameters |
object | The given parameters. |
$parameters.$stage |
Stage | The stage on which to execute the system. |
$parameters.$timetick |
number | The tick duration (in ms). |