SilkButtonOptions
import type { SilkButtonOptions } from 'pixi-silk/ui/button';
Options of SilkButton.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
appearOffset? | number | Distance it rises from when it appears, local units. Default 10. | ui/SilkButton.ts:94 |
appearScale? | number | Scale the button grows from when it appears. Default 0.6. | ui/SilkButton.ts:92 |
enabled? | boolean | Initial value of state.enabled. Default true. | ui/SilkButton.ts:88 |
height? | number | Height in local units. Default 48. The button is centred on its origin. | ui/SilkButton.ts:70 |
hitPadding? | number | Extra hit margin around the shape in local units (a finger landing a little outside still counts). Default 6. | ui/SilkButton.ts:96 |
holdMs? | number | Long-press time in ms. A press held this long fires onHold instead of onPress. Off when left out. | ui/SilkButton.ts:90 |
icon? | IconSource | Icon shown before the label. See IconSource. | ui/SilkButton.ts:78 |
iconSize? | number | Icon size in local units. Default 22. | ui/SilkButton.ts:80 |
label? | string | Text shown after the icon, about 15 px semibold system font unless textStyle says otherwise. | ui/SilkButton.ts:76 |
onHold? | (button: SilkButton) => void | Called once when a press is held for holdMs. | ui/SilkButton.ts:104 |
onPress? | (button: SilkButton) => void | Called on release over the button while state.active. Not called after a hold fired. | ui/SilkButton.ts:102 |
profiles? | Partial<Record<InputKind, Partial<InputProfile>>> | Per pointer kind overrides. The slop sets how far a press may slide off and still count. | ui/SilkButton.ts:98 |
radius? | number | Corner radius of rect and squircle, local units. Default 14. | ui/SilkButton.ts:74 |
shape? | "rect" | "pill" | "circle" | "squircle" | Default pill. squircle uses continuous corners. | ui/SilkButton.ts:72 |
shown? | boolean | Start visible. Default true. | ui/SilkButton.ts:86 |
textStyle? | TextStyleOptions | Pixi text style merged over the label’s default style. | ui/SilkButton.ts:82 |
theme? | Partial<ButtonTheme> | Colours merged over BUTTON_THEME. Read once, at construction. | ui/SilkButton.ts:84 |
ticker? | Ticker | null | Ticker that runs the animation. Default Ticker.shared. With null, call SilkButton.tick yourself. | ui/SilkButton.ts:100 |
width? | number | Width in local units. Default 120. Circles ignore it and use height. | ui/SilkButton.ts:68 |