ModeSwitcherOptions
import type { ModeSwitcherOptions } from 'pixi-silk/ui/modes';
Options of ModeSwitcher.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
holdMs? | number | How long the key must be held before the ring shows. Default 160 ms. | ui/modes.ts:27 |
initial? | string | Starting mode id. Default the first mode. | ui/modes.ts:23 |
key? | string | null | Hold this key (a KeyboardEvent.code) to show the ring. A quick tap swaps to the previous mode. Default Space. null turns keys off. | ui/modes.ts:25 |
longPressMs? | number | Long-press time. Default 380 ms. | ui/modes.ts:31 |
longPressTarget? | Container<ContainerChild> | A long-press on this container shows the ring under the finger. | ui/modes.ts:29 |
menu? | Omit<RadialMenuOptions, "ticker" | "onSelect" | "onClose" | "items"> | Look and feel of the ring (any RadialMenuOptions except items and callbacks). | ui/modes.ts:33 |
modes | RadialItem[] | The modes. Items with children are not supported here. | ui/modes.ts:21 |
onChange? | (mode: string, previous: string | null) => void | Called after the mode changes, with the new id and the one before it. | ui/modes.ts:37 |
ticker? | Ticker | null | Ticker driving the animation. Default Ticker.shared. null for manual ModeSwitcher.tick. | ui/modes.ts:35 |