Class TransformTool

变换控制器工具

Hierarchy (view full)

Constructors

Properties

_currentToolIdMask: Ref<string> = ...

This is a hack / escape hatch that will tell the editor to report a different state as active (in getCurrentToolId()) when this state is active. This is usually used when a tool transitions to a child of a different state for a certain interaction and then returns to the original tool when that interaction completes; and where we would want to show the original tool as active in the UI.

app: App
children?: Record<string, StateNode>
editor: App
id: string
initial?: string
onContextMenu?: ((info) => void)

Type declaration

onKeyDown?: ((info) => void)

Type declaration

onKeyUp?: ((info) => void)

Type declaration

onMouseClick?: ((info) => void)

Type declaration

onMouseDblClick?: ((info) => void)

Type declaration

onMouseDown?: ((info) => void)

Type declaration

onMouseEnter?: ((info) => void)

Type declaration

onMouseLeave?: ((info) => void)

Type declaration

onMouseMove?: ((info) => void)

Type declaration

onMouseOut?: ((info) => void)

Type declaration

onMouseOver?: ((info) => void)

Type declaration

onMouseUp?: ((info) => void)

Type declaration

onMouseWheel?: ((info) => void)

Type declaration

onPointerCancel?: ((info) => void)

Type declaration

onPointerDown?: ((info) => void)

Type declaration

onPointerDownUp?: ((info) => void)

Type declaration

onPointerMove?: ((info) => void)

Type declaration

onPointerUp?: ((info) => void)

Type declaration

parent: StateNode
type: TLStateNodeType
id: string = 'transform'
initial: string = 'idle'

Methods

  • This node's current active child node, if any.

    Returns any

  • Whether this node is active.

    Returns boolean

  • This node's path of active state nodes

    Returns string

  • Transition to a new active child state node.

    Parameters

    • id: string

      The id of the child state node to transition to.

    • info: {
          event?: InteractiveEvent;
          name?: string;
          object?: InteractiveObject;
          [key: string]: any;
      } = {}

      Any data to pass to the onEnter and onExit handlers.

    Returns TransformTool

    Example

    parentState.transition('childStateA')
    parentState.transition('childStateB', { myData: 4 })
  • Returns typeof Idle[]