ContextHaloOptions
import type { ContextHaloOptions } from 'pixi-silk/ui/halo';
Options of ContextHalo. Lengths are in the halo’s local units.
Properties#
| Property | Type | Description | Defined 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? | number | Preferred side, as an angle in radians from the target’s centre. -PI/2 (default) is above. | ui/halo.ts:78 |
gap? | number | Distance between the target’s box and the buttons. Default 10. | ui/halo.ts:72 |
hideWhileDragging? | boolean | Folds the buttons away while state.dragging is true. Default false: they follow. | ui/halo.ts:82 |
iconSize? | number | Icon size. Default 18. | ui/halo.ts:76 |
items | HaloItem[] | The actions, in order along the arc. Replace them later with ContextHalo.setItems. | ui/halo.ts:68 |
onSelect? | (item: HaloItem) => void | Called 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? | number | Radius of each button. Default 18. | ui/halo.ts:70 |
spacing? | number | Space 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 | null | Ticker 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 |