Skip to content
pixi-silk
GitHub repository
Interface

GuidesOptions

import type { GuidesOptions } from 'pixi-silk/ui/guides';

Options of Guides.

Properties#

PropertyTypeDescriptionDefined in
cameraCameraThe camera the guides follow. The layer redraws whenever the camera’s signals change.ui/guides.ts:44
color?ColorSourceLine colour, also the drag pill’s fill. Default 0xff375f.ui/guides.ts:48
format?(value: number) => stringTurns 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?LabelFactoryBuilds 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[]) => voidCalled 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?numberRounds guides to this world step while dragging, when snapping misses. Default 1. 0 turns it off.ui/guides.ts:57
ruler?RulerDrag 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 | GuideSnapSnapping 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?numberSnap distance in CSS pixels. Default 6.ui/guides.ts:55
ticker?Ticker | nullTicker that runs fades and redraws. Default Ticker.shared. With null, call Guides.tick yourself.ui/guides.ts:70