Skip to content
pixi-silk
GitHub repository
Entry point

pixi-silk/ui/guides

Guides: draggable guide lines from the rulers.

import { Guides, snapValue } from 'pixi-silk/ui/guides';

Classes#

ClassDescription
GuidesGuide lines over a Camera’s world. Drag a guide out of a Ruler: the top ruler gives a horizontal one, the left a vertical one. Drag a guide to move it, drop it back on the ruler to remove it. A pill shows the position while dragging. Guides.bindSnap feeds the guides to a snap engine, so objects snap to them.

Interfaces#

InterfaceDescription
GuideA guide line. Guide objects are replaced, not mutated, when a guide moves.
GuideDragA guide being dragged: where it is now, and whether letting go here removes it.
GuidesOptionsOptions of Guides.
GuidesStateThe reactive state of a Guides layer.

Type Aliases#

Type AliasDescription
GuideSnapSnaps a guide while it is dragged. Gets the raw position and the snap distance, both in world units, and returns where the guide should go. Return at unchanged to let rounding apply.

Functions#

FunctionDescription
snapValueThe value of candidates within threshold of v that is nearest, or v when none is. A tie keeps the first.