Skip to content
pixi-silk
GitHub repository
Interface

ModeSwitcherOptions

import type { ModeSwitcherOptions } from 'pixi-silk/ui/modes';

Options of ModeSwitcher.

Properties#

PropertyTypeDescriptionDefined in
holdMs?numberHow long the key must be held before the ring shows. Default 160 ms.ui/modes.ts:27
initial?stringStarting mode id. Default the first mode.ui/modes.ts:23
key?string | nullHold 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?numberLong-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
modesRadialItem[]The modes. Items with children are not supported here.ui/modes.ts:21
onChange?(mode: string, previous: string | null) => voidCalled after the mode changes, with the new id and the one before it.ui/modes.ts:37
ticker?Ticker | nullTicker driving the animation. Default Ticker.shared. null for manual ModeSwitcher.tick.ui/modes.ts:35