InputComponent

Actor component for handling input.

Constructor

new InputComponent(customCondition)

Create a new input component.
Parameters:
NameTypeDefaultDescription
customConditionfunctionnullFunction 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.

draw(ctx)

Draw the component.
Parameters:
NameTypeDescription
ctxCanvasRenderingContext2DCanvas context to draw on

drawDebug(ctx)

Draw debugging info for the component.
Parameters:
NameTypeDescription
ctxCanvasRenderingContext2DCanvas context to draw on

init()

Initialize the component.

update(elapsed)

Update the component.
Parameters:
NameTypeDescription
elapsednumberTime since last update cycle in seconds