GuidesOptions
import type { GuidesOptions } from 'pixi-silk/ui/guides';
Options of Guides.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
camera | Camera | The camera the guides follow. The layer redraws whenever the camera’s signals change. | ui/guides.ts:44 |
color? | ColorSource | Line colour, also the drag pill’s fill. Default 0xff375f. | ui/guides.ts:48 |
format? | (value: number) => string | Turns a guide position into the pill text. Default rounds to two decimals. | ui/guides.ts:59 |
guides? | readonly Omit<Guide, "id">[] | Guides to start with. They get ids 1, 2 and so on, and do not call onChange. | ui/guides.ts:66 |
label? | LabelFactory | Builds the pill text. Default a PixiJS Text. Pass silkLabel() from pixi-silk/text to draw it as SDF text instead. | ui/guides.ts:64 |
onChange? | (guides: readonly Guide[]) => void | Called when a drag ends: a guide was added, moved or removed. Not called by the methods. | ui/guides.ts:72 |
profiles? | Partial<Record<InputKind, Partial<InputProfile>>> | Per pointer kind overrides of slop, which widens the grab distance around a line. | ui/guides.ts:68 |
round? | number | Rounds guides to this world step while dragging, when snapping misses. Default 1. 0 turns it off. | ui/guides.ts:57 |
ruler? | Ruler | Drag new guides out of this ruler, and drop guides on it to remove them. Adds listeners to the ruler. | ui/guides.ts:46 |
snap? | | SnapEngine | GuideSnap | Snapping while dragging: a SnapEngine (edges and centres of its targets, its points and lines) or your own function. Ctrl or Cmd turns it off for a drag. | ui/guides.ts:53 |
snapThreshold? | number | Snap distance in CSS pixels. Default 6. | ui/guides.ts:55 |
ticker? | Ticker | null | Ticker that runs fades and redraws. Default Ticker.shared. With null, call Guides.tick yourself. | ui/guides.ts:70 |