@vaguevoid/fiasco / ecs/resources / Inputs
Class: Inputs
Defined in: src/ecs/resources.ts:826
The Inputs Resource provides information about current frame inputs, such as mouse and keyboard data.
function system(inputs: Inputs) {
if (inputs.mouse.left.isPressed) {
console.log('mouse is clicked!')
}
}
Extends
Accessors
mouse
Get Signature
get mouse():
object
Defined in: src/ecs/resources.ts:867
Data about the current position of the mouse in the screen. Includes data about which mouse buttons are down/up.
Returns
object
left
left:
ButtonState
middle
middle:
ButtonState
right
right:
ButtonState
x
x:
number
y
y:
number
wheel
Get Signature
get wheel():
object
Defined in: src/ecs/resources.ts:883
Data about the mouse scroll wheel positioning.
Returns
object
x
x:
number
y
y:
number
Methods
deserialize()
deserialize(
bytes
):boolean
Defined in: src/ecs/resources.ts:70
Parameters
bytes
Uint8Array
Returns
boolean
Inherited from
key()
key(
code
):ButtonState
Defined in: src/ecs/resources.ts:858
Data about the provided keyboard key state.
Parameters
code
Keyboard key code
Returns
Data about if the key is pressed or not.
serialize()
serialize():
Uint8Array
Defined in: src/ecs/resources.ts:65
Returns
Uint8Array