PathGizmo and PenTool: edit and draw Bezier paths.
import { PathGizmo, PenTool } from 'pixi-silk/ui/pathgizmo';
Classes#
| Class | Description |
|---|
| PathGizmo | Edits a cubic bezier path: anchors, handles and segments, plus a pen tool that adds anchors. |
| PenTool | The pen tool’s state machine, without pointer events or drawing: feed it presses, moves and releases in path coordinates and read the path back. A click adds a corner. A drag pulls out mirrored handles, and Alt moves only the outgoing one. A click on the first anchor closes the path, and a click on the last one drops its outgoing handle. PathGizmo drives one. |
Interfaces#
Type Aliases#
| Type Alias | Description |
|---|
| PathHit | A part of the path under the pointer. index is an anchor index. A segment hit has the curve parameter t (0 to 1) and the nearest point (x, y) in path coordinates. |
| PathTool | The two modes of a PathGizmo. |
| PenPhase | Where the pen tool is. - idle: not drawing. The next click starts or continues the path. - drawing: the next click adds an anchor. - dragging: the button is down on the newly placed anchor, and the drag pulls out its handles. - closing: the click closed the path, and the drag shapes the first anchor. |
Variables#
| Variable | Description |
|---|
| PATH_GIZMO_THEME | Default theme: a blue outline with white anchors. Override single colours with the theme option. |