Constructor
new InputComponent(customCondition)
Create a new input component.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
customCondition | function | null | Function for checking if input manager should run events |
Extends
Members
keyboard
Get the keyboard input handler.
mouse
Get the mouse input handler.
Methods
destructor()
Handle the deletion of the component.
- Overrides
draw(ctx)
Draw the component.
Parameters:
Name | Type | Description |
---|---|---|
ctx | CanvasRenderingContext2D | Canvas context to draw on |
- Overrides
drawDebug(ctx)
Draw debugging info for the component.
Parameters:
Name | Type | Description |
---|---|---|
ctx | CanvasRenderingContext2D | Canvas context to draw on |
- Overrides
init()
Initialize the component.
- Overrides
update(elapsed)
Update the component.
Parameters:
Name | Type | Description |
---|---|---|
elapsed | number | Time since last update cycle in seconds |
- Overrides