Host typegenerated
Action
What the player means rather than what they pressed: the input actions the scene declares, such as "jump" or "move", each bound to keys, buttons and sticks that can be changed while the game runs. A binding is written as text: "key.Space", two sources for an axis ("key.A/key.D"), or four for a direction ("key.W/key.S/key.A/key.D"). A name the scene does not declare is an error.
8 members · engine 0.1.0
Action.axis(name: String) -> numberAn axis action's value, from -1 to 1.Action.bindings(name: String) -> List<String>What an action is bound to now, as a list of binding texts.Action.held(name: String) -> boolWhether an action is being made now.Action.last_pressed() -> StringThe key, mouse button or controller button pressed this frame, as a source name such as"key.J", or empty text: for a screen that waits for the key to rebind to.Action.pressed(name: String) -> boolWhether an action started this frame.Action.rebind(name: String, index: number, binding: String) -> unitReplaces an action's binding atindexwith a binding text, or adds one at the next index. A binding that cannot make the action's kind is refused.Action.released(name: String) -> boolWhether an action stopped this frame.Action.vector(name: String) -> Vec2A direction action's value, as a Vec2 with right and up positive.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b