KeyControls
Mouse controls
Constructor Summary
Public Constructor | ||
public |
constructor(stage: Stage, params: Object) |
Member Summary
Public Members | ||
public |
|
|
public |
Flag to disable all actions |
|
public |
|
Method Summary
Public Methods | ||
public |
Add a key action triggered by pressing the given character. |
|
public |
Remove all key actions |
|
public |
Set key action preset |
|
public |
Remove a key action. |
|
public |
run() |
Public Constructors
Public Methods
public add(char: Char, callback: Function): undefined source
Add a key action triggered by pressing the given character. The KeyActions class provides a number of static methods for use as callback functions.
Example:
// call KeyActions.toggleRock when "k" is pressed
stage.keyControls.remove( "k", KeyActions.toggleRock );
public preset(name: String): undefined source
Set key action preset
Params:
Name | Type | Attribute | Description |
name | String | one of "default" |
public remove(char: Char, callback: Function): undefined source
Remove a key action. When the callback function is given, only actions that call that function are removed.
Example:
// remove all actions triggered by pressing "k"
stage.keyControls.remove( "k" );
// remove action `toggleRock` triggered by pressing "k"
stage.keyControls.remove( "k", toggleRock );