Host typegenerated
Input
Every way the player reaches the game, in one place. Start with Input.Action, which works the same whatever the player holds; Input.Pointer, Input.Stick and Input.Gesture for mouse and touch; Input.Keyboard, Input.Touch and Input.Gamepad for one device read directly. The calls directly on Input are the keyboard, kept for older scripts: prefer Input.Keyboard.
11 members · engine 0.1.0
Input.Action: ActionWhat the player means, such as"jump"or"move", from the actions the scene declares. The best place to start: one script works with keys, a controller or a touch screen. The same asAction.Input.Gamepad: GamepadGame controllers, read by player number. The same asGamepad.Input.Gesture: GestureTaps, holds, drags and pinches, for touch-first controls. The same asGesture.Input.Keyboard: KeyboardThe keys, named by position so controls work on any keyboard layout.Input.Pointer: PointerThe mouse, or a finger on a touch screen, handled the same way so one game works on both. The same asPointer.Input.Stick: StickA virtual joystick for touch screens: wherever a thumb lands becomes the center, and dragging from there steers. The same asStick.Input.Touch: TouchEvery finger on a touch screen, for games that need more than one. For steering,Input.Stickis simpler. The same asTouch.Input.axis(negative: String, positive: String) -> number-1, 0 or 1 from a pair of keys, for movement:Input.Keyboard.axis("A", "D")is -1 holding A, 1 holding D and 0 for neither or both.Input.is_down(key: String) -> boolWhether a key is being held down.Input.just_pressed(key: String) -> boolWhether a key was pressed this frame. True only once per press, however long it is held.Input.just_released(key: String) -> boolWhether a key was let go this frame.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b