Skip to content
pixi-silk
GitHub repository
Interface

TransformGizmoOptions

import type { TransformGizmoOptions } from 'pixi-silk/ui/gizmo';

Options of TransformGizmo.

Properties#

PropertyTypeDescriptionDefined in
apply?booleanWrite the new transform into the target. Default true. Set false to apply it yourself in onChange.ui/gizmo.ts:128
mode?GizmoModeTools shown at first. Default universal.ui/gizmo.ts:106
onChange?(transform: GizmoTransform, handle: GizmoHandle) => voidEvery drag step, with the new transform. Called whether or not apply writes it.ui/gizmo.ts:138
onEnd?(transform: GizmoTransform, handle: GizmoHandle) => voidA drag ended, also when attach moves to another target mid-drag.ui/gizmo.ts:140
onStart?(handle: GizmoHandle, transform: GizmoTransform) => voidA drag started. transform is the target’s transform before it.ui/gizmo.ts:136
profiles?Partial<Record<InputKind, Partial<InputProfile>>>Per pointer kind overrides of the hit tolerance and handle size.ui/gizmo.ts:132
readout?booleanShow a value pill (angle, size, offset) while dragging. Default true.ui/gizmo.ts:120
size?numberLength of the axis handles, in gizmo units. Default 84. Grows for touch.ui/gizmo.ts:112
snap?GizmoSnapInitial snap steps. Later changes go to TransformGizmo.snap.ui/gizmo.ts:114
snapEngine?SnapEngineSmart guides for free moves: aligns the target’s bounds with other objects. Ctrl or Cmd turns them off.ui/gizmo.ts:116
snapGuides?SnapGuidesDraws what snapEngine found. Put it in the target’s parent space.ui/gizmo.ts:118
space?GizmoSpaceAxes of the move handles at first. Default local. Scale handles always follow the object’s own axes.ui/gizmo.ts:108
target?Container<ContainerChild> | nullObject to transform. It can sit in another container than the gizmo, which follows it on screen.ui/gizmo.ts:110
theme?Partial<GizmoTheme>Colours merged over GIZMO_THEME. Read once, at construction.ui/gizmo.ts:130
ticker?Ticker | nullTicker that runs the animation and follows the target. Default Ticker.shared. With null, call TransformGizmo.tick yourself.ui/gizmo.ts:134
transition?"pop" | "glide"What happens when the gizmo moves to another object. pop (default): the old handles shrink away where they were, the new ones spring in group by group, and input waits until they land. glide: the handles slide over. Following the same object is always exact.ui/gizmo.ts:126