API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classVectorAction

@codexo/exojs / input / stable

A named two-dimensional input, fed by a stick, by four direction buttons, or by several such bindings at once. Each alternative binding is evaluated as a whole vector and the longest one wins, so x never comes from the keyboard while y comes from the pad. The result is clamped to unit length rather than normalized: a digital diagonal is no faster than a cardinal direction, while analog input below full deflection keeps its magnitude.

6
props
1
methods
0
events
Import
import { VectorAction } from '@codexo/exojs'

A named two-dimensional input, fed by a stick, by four direction buttons, or by several such bindings at once.

Each alternative binding is evaluated as a whole vector and the longest one wins, so x never comes from the keyboard while y comes from the pad. The result is clamped to unit length rather than normalized: a digital diagonal is no faster than a cardinal direction, while analog input below full deflection keeps its magnitude.

Constructors1
Methods1
Properties6
kind: "vector"
Which action kind this is - the discriminant a serialized binding is validated against.
active: boolean
true while the vector's length exceeds the action's threshold.
binding: Binding
The binding currently in effect: the default, or whatever last replaced it.
channels: readonly number[]
Absolute channel indices this action reads right now. Reflects the effective binding and the owning map's gamepad slot, and is what an InputScope claims on this action's behalf. The array is replaced, not mutated, on every rebind - do not retain it across one.
defaultBinding: Binding
The binding this action was constructed with - what a null rebind restores.
Source