Skip to content
pixi-silk
GitHub repository
Interface

ContextHaloOptions

import type { ContextHaloOptions } from 'pixi-silk/ui/halo';

Options of ContextHalo. Lengths are in the halo’s local units.

Properties#

PropertyTypeDescriptionDefined in
bounds?HaloBounds | (() => HaloBounds)The buttons stay inside this rectangle, turning to another side of the target when needed. A function is called several times per frame, so keep it cheap.ui/halo.ts:80
direction?numberPreferred side, as an angle in radians from the target’s centre. -PI/2 (default) is above.ui/halo.ts:78
gap?numberDistance between the target’s box and the buttons. Default 10.ui/halo.ts:72
hideWhileDragging?booleanFolds the buttons away while state.dragging is true. Default false: they follow.ui/halo.ts:82
iconSize?numberIcon size. Default 18.ui/halo.ts:76
itemsHaloItem[]The actions, in order along the arc. Replace them later with ContextHalo.setItems.ui/halo.ts:68
onSelect?(item: HaloItem) => voidCalled when a button is tapped: pressed and released on the same enabled button while the halo is shown.ui/halo.ts:95
profiles?Partial<Record<InputKind, Partial<InputProfile>>>Per pointer kind overrides of slop, the hit margin of a button and how far a press may slide.ui/halo.ts:91
radius?numberRadius of each button. Default 18.ui/halo.ts:70
spacing?numberSpace between neighbouring buttons. Default 8.ui/halo.ts:74
theme?Partial<HaloTheme>Colours that replace parts of HALO_THEME. Read once, in the constructor.ui/halo.ts:89
ticker?Ticker | nullTicker driving the animation. Default Ticker.shared. null for manual ContextHalo.tick.ui/halo.ts:93
transition?"pop" | "glide"How the buttons move to a new target. pop (default) pops them out at the old target and back in around the new one. glide slides them across. Following one target is always smooth.ui/halo.ts:87