API reference

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

C

classGamepadPromptLayouts

@codexo/exojs / input / stable

Static utility that drives in-game controller-prompt UI. Provides the canonical set of prompt controls, their normalised [x, y] positions on a generic controller silhouette, device-family label strings (e.g. "A" for Xbox, "Cross" for PlayStation, "B" for Switch), and the mapping from prompt control names to GamepadButton channel values.

1
props
3
methods
0
events
Import
import { GamepadPromptLayouts } from '@codexo/exojs'

Static utility that drives in-game controller-prompt UI.

Provides the canonical set of prompt controls, their normalised [x, y] positions on a generic controller silhouette, device-family label strings (e.g. "A" for Xbox, "Cross" for PlayStation, "B" for Switch), and the mapping from prompt control names to GamepadButton channel values.

Constructors1
new(): GamepadPromptLayouts
Methods3
Returns the label map for a device, e.g. { ButtonSouth → "A" } for Xbox or { ButtonSouth → "Cross" } for PlayStation. Falls back to generic labels when the family has no registered label set. Pass the connected pad's GamepadMapping rather than its family whenever you have one: a family spans several product generations, and the mapping contributes the labels that differ between them through GamepadMapping.promptLabels - "Share" on a DualShock 4 where the family default reads "Create". The merged map is cached per mapping.
Returns the normalised [x, y] position of control on a generic controller silhouette, where (0, 0) is the top-left and (1, 1) the bottom-right. Falls back to [0.5, 0.5] (centre) when the control has no registered position.
Properties1
Source