Skip to main content

DefaultTouchControlsOptions

@zylem/game-lib


@zylem/game-lib / input-ui / DefaultTouchControlsOptions

Interface: DefaultTouchControlsOptions

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:39

Properties​

buttonAccents?​

optional buttonAccents?: Partial<Record<VirtualTouchButtonSlot, string>>

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:54

Per-button accent color overrides (override theme buttonAccents).


buttonLabels?​

optional buttonLabels?: Partial<Record<VirtualTouchButtonSlot, string>>

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:56

Custom labels for buttons (default uses the slot name, e.g. 'A').


buttons?​

optional buttons?: VirtualTouchButtonSlot[]

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:52

Buttons to render. Default ['A', 'B']. Buttons not listed here are disabled. Pass [] to render no buttons.


enabled?​

optional enabled?: boolean | "auto"

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:45

Controls whether the touch UI mounts. 'auto' (default) lets the provider show controls only on touch/mobile devices. true forces it on (useful for testing on desktop), false disables the UI entirely.


joysticks?​

optional joysticks?: JoystickSelection

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:64

Which joysticks to render. Default 'left'.

  • 'left' : analog left only
  • 'right' : analog right only
  • 'both' : both sticks
  • 'none' : disable all joysticks

override?​

optional override?: VirtualTouchConfig

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:71

Escape hatch — a raw VirtualTouchConfig merged on top of the generated config. Use this when you need fine-grained tweaks (custom positions, sizes, raw SVG) without reaching for the lower-level useVirtualControls(...) preset.


theme?​

optional theme?: "default" | TouchTheme | "lagoon"

Defined in: packages/game-lib/src/lib/input-ui/default-controls.ts:47

Theme name ('default' / 'lagoon') or a custom TouchTheme.