RulerOptions
import type { RulerOptions } from 'pixi-silk/ui/ruler';
Options of Ruler.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
accent? | ColorSource | Colour of the selection band, its edge labels and the cursor marker. Default 0x0a84ff. | ui/ruler.ts:35 |
background? | ColorSource | Bar background. Default 0x1c1c1e. | ui/ruler.ts:29 |
camera | Camera | The camera the ruler reads. The ruler redraws whenever the camera’s signals change. | ui/ruler.ts:23 |
fontSize? | number | Label font size in pixels. Default 10. | ui/ruler.ts:39 |
format? | (value: number, step: number) => string | Turns a world value into a label. step is the distance between labels. Default whole numbers, or as many decimals as a step below 1 needs (at most 6). | ui/ruler.ts:44 |
label? | LabelFactory | Builds the label text. Default a PixiJS Text at resolution 3. Pass silkLabel() from pixi-silk/text to draw labels as SDF text instead. | ui/ruler.ts:49 |
labelSpacing? | number | Smallest distance between labels in CSS pixels. Default 72. The step rounds up to 1, 2 or 5 times a power of ten. | ui/ruler.ts:37 |
sides? | "left" | "top" | "both" | Which rulers to draw. Default both. | ui/ruler.ts:25 |
size? | number | Bar thickness in CSS pixels. Default 20. | ui/ruler.ts:27 |
textColor? | ColorSource | Label colour. Default 0x8e8e93. | ui/ruler.ts:33 |
tickColor? | ColorSource | Tick colour, drawn at 28% opacity. Default white. | ui/ruler.ts:31 |
ticker? | Ticker | null | Ticker that runs fades and redraws. Default Ticker.shared. With null, call Ruler.tick yourself. | ui/ruler.ts:53 |
trackCursor? | boolean | Follows the pointer over the camera’s element with a marker. Adds pointer listeners to the element. Default true. | ui/ruler.ts:51 |