ButtonBlockOptions
import type { ButtonBlockOptions } from 'pixi-silk/ui/blocks';
Options of a ButtonBlock.
Extends#
Properties#
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
active? | Value<boolean> | Toggled look (a lit face). | - | packages/pixi-silk/src/ui/blocks.ts:837 |
colors? | ButtonColors | Colours. | - | packages/pixi-silk/src/ui/blocks.ts:841 |
enabled? | Value<boolean> | Whether it takes input. A disabled button dims. Default true. | - | packages/pixi-silk/src/ui/blocks.ts:839 |
flat? | boolean | The cheap look: the face is one shape with its border, its colour mixed on the CPU from the base, active, hover and disabled states, and no blurred shadow. A full button stacks up to six layers over its face while it animates. Default on for a lowEnd surface, else off. | - | packages/pixi-silk/src/ui/blocks.ts:851 |
height? | number | Height. Default 0 (set by the layout through onSize). | BlockOptions.height | packages/pixi-silk/src/ui/blocks.ts:42 |
icon? | IconPainter | Icon on the face, drawn with SilkGraphics shapes. | - | packages/pixi-silk/src/ui/blocks.ts:835 |
label? | Value<string> | Text on the face. | - | packages/pixi-silk/src/ui/blocks.ts:831 |
labelStyle? | DrawTextStyle | Font of the label. Default 20 px bold. | - | packages/pixi-silk/src/ui/blocks.ts:833 |
layer? | BlockLayer | Which layer of the surface paints the block. 'auto' (default) starts in the cached still layer and moves to the live layer the first time the block animates or changes. 'still' stays in the still layer: a change repaints and re-caches that layer, and the block keeps its place under live blocks. 'live' starts in the live layer. | BlockOptions.layer | packages/pixi-silk/src/ui/blocks.ts:49 |
onPress | () => void | Called on a press. | - | packages/pixi-silk/src/ui/blocks.ts:825 |
pressScale? | number | Scale while pressed. Default 0.92. | - | packages/pixi-silk/src/ui/blocks.ts:843 |
radius? | number | Corner radius of 'rect', design units. Default 16. | - | packages/pixi-silk/src/ui/blocks.ts:829 |
shadow? | number | Soft shadow under the face: blur in design units, 0 for none. Default 0. Free at rest when the surface caches. | - | packages/pixi-silk/src/ui/blocks.ts:845 |
shape? | "rect" | "pill" | "circle" | Face shape. Default 'pill'. | - | packages/pixi-silk/src/ui/blocks.ts:827 |
width? | number | Width. Default 0 (set by the layout through onSize). | BlockOptions.width | packages/pixi-silk/src/ui/blocks.ts:40 |