Host typegenerated
Gamepad
Game controllers. Each player gets a number from 1 to 8 when they press a button on their controller; 0 means any controller.
8 members · engine 0.1.0
Gamepad.axis(slot: number, axis: String) -> numberHow far a stick or trigger is pushed. Sticks ("left_x","left_y"…) give -1 to 1, with right and down positive; triggers give 0 to 1.Gamepad.count() -> numberHow many players have joined with a controller.Gamepad.is_connected(slot: number) -> boolWhether a player number has a connected controller.Gamepad.is_down(slot: number, button: String) -> boolWhether a controller button is held. Buttons are named by position, so"south"is the bottom face button on every make of controller.Gamepad.joined() -> numberThe player number of a controller that joined this frame, or 0. Use it to add a player.Gamepad.just_pressed(slot: number, button: String) -> boolWhether a mouse button was pressed this frame.Gamepad.just_released(slot: number, button: String) -> boolWhether a controller button was let go this frame.Gamepad.left() -> numberThe player number of a controller that was unplugged this frame, or 0. Use it to remove a player.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b