Skip to main content

Function: addInputs()

addInputs(world, container, cameraEntity, screenWidth, screenHeight): Entity

Defined in: input/utilities/add-inputs.ts:14

Adds an InputsComponent to the world and initializes the input system.

Parameters

world

World

The world to which the inputs component will be added.

container

HTMLElement

The HTML element that will receive input events.

cameraEntity

Entity

The entity representing the camera.

screenWidth

number

The width of the screen.

screenHeight

number

The height of the screen.

Returns

Entity

The entity that contains the InputsComponent.