Variable handleConst
handle: (target: Writable<Vec>, opts?: HandleOpts) => Handle & {
anchor: (
shape: AnyShape & Has<"translate">,
u: number,
v: number,
opts?: HandleOpts,
) => Handle;
centroid: (...shapes: (AnyShape & Has<"translate">)[]) => Handle;
midpoint: (a: Writable<Vec>, b: Writable<Vec>, opts?: HandleOpts) => Handle;
move: (shape: AnyShape & Has<"translate">, opts?: HandleOpts) => Handle;
rotate: (
shape: AnyShape & Has<"rotate">,
radius?: number,
opts?: HandleOpts,
) => Handle;
scale: (
shape: AnyShape & Has<"scale">,
radius?: number,
opts?: HandleOpts,
) => Handle;
tOnPath: (
p: Path,
t: Cell<number>,
opts?: HandleOpts & { samples?: number },
) => Handle;
} = ...
anchor: (
shape: AnyShape & Has<"translate">,
u: number,
v: number,
opts?: HandleOpts,
) => Handle;
centroid: (...shapes: (AnyShape & Has<"translate">)[]) => Handle;
midpoint: (a: Writable<Vec>, b: Writable<Vec>, opts?: HandleOpts) => Handle;
move: (shape: AnyShape & Has<"translate">, opts?: HandleOpts) => Handle;
rotate: (
shape: AnyShape & Has<"rotate">,
radius?: number,
opts?: HandleOpts,
) => Handle;
scale: (
shape: AnyShape & Has<"scale">,
radius?: number,
opts?: HandleOpts,
) => Handle;
tOnPath: (
p: Path,
t: Cell<number>,
opts?: HandleOpts & { samples?: number },
) => Handle;
} = ...
Type Declaration
- (target: Writable<Vec>, opts?: HandleOpts): Handle
Parameters
- target: Writable<Vec>
- opts: HandleOpts = {}
Returns Handle
anchor: (
shape: AnyShape & Has<"translate">,
u: number,
v: number,
opts?: HandleOpts,
) => HandleDrag handle at a specific anchor
(u, v)of the shape — drag translates the shape so that anchor lands at the pointer.centroid: (...shapes: (AnyShape & Has<"translate">)[]) => Handle
midpoint: (a: Writable<Vec>, b: Writable<Vec>, opts?: HandleOpts) => Handle
Drag handle at the midpoint of two writable Points — drags both along with it.
move: (shape: AnyShape & Has<"translate">, opts?: HandleOpts) => Handle
Drag handle at the shape's center — drags translate the shape.
rotate: (shape: AnyShape & Has<"rotate">, radius?: number, opts?: HandleOpts) => Handle
Rotation knob orbiting the shape's center at
radius; drag to writeshape.rotate.scale: (shape: AnyShape & Has<"scale">, radius?: number, opts?: HandleOpts) => Handle
tOnPath: (p: Path, t: Cell<number>, opts?: HandleOpts & { samples?: number }) => Handle
Handle constrained to a Path: each drag projects the pointer onto the path and sets
tto the nearest parameter (re-projects, so animated paths work).
handle(point)is the atom;.move,.centroid, etc. are sugar.