HandTool
Table of contents
- children
- id
- initial
- isLockable
- _currentToolIdMask
- _path
- editor
- enter
- exit
- handleEvent
- onCancel
- onComplete
- onDoubleClick
- onEnter
- onExit
- onInterrupt
- onKeyDown
- onKeyRepeat
- onKeyUp
- onLongPress
- onMiddleClick
- onPointerDown
- onPointerMove
- onPointerUp
- onQuadrupleClick
- onRightClick
- onTick
- onTripleClick
- onWheel
- parent
- performanceTracker
- shapeType
- transition
- type
- Properties
- Methods
Extends StateNode
.
class HandTool extends StateNode {}
from
StateNode
Constructs a new instance of the StateNode
class
Parameters
Properties
static children: () => TLStateNodeConstructor[]
static id: string
static initial: string
static isLockable: boolean
from
StateNode
editor: Editor
from
StateNode
enter: (info: any, from: string) => void
from
StateNode
exit: (info: any, from: string) => void
from
StateNode
handleEvent: (info: Exclude<TLEventInfo, TLPinchEventInfo>) => void
from
StateNode
onCancel?: TLEventHandlers['onCancel']
from
StateNode
onComplete?: TLEventHandlers['onComplete']
onDoubleClick: TLClickEvent
from
StateNode
onEnter?: TLEnterEventHandler
from
StateNode
onExit?: TLExitEventHandler
from
StateNode
onInterrupt?: TLEventHandlers['onInterrupt']
from
StateNode
onKeyDown?: TLEventHandlers['onKeyDown']
from
StateNode
onKeyRepeat?: TLEventHandlers['onKeyRepeat']
from
StateNode
onKeyUp?: TLEventHandlers['onKeyUp']
from
StateNode
onLongPress?: TLEventHandlers['onLongPress']
from
StateNode
onMiddleClick?: TLEventHandlers['onMiddleClick']
from
StateNode
onPointerDown?: TLEventHandlers['onPointerDown']
from
StateNode
onPointerMove?: TLEventHandlers['onPointerMove']
from
StateNode
onPointerUp?: TLEventHandlers['onPointerUp']
onQuadrupleClick: TLClickEvent
from
StateNode
onRightClick?: TLEventHandlers['onRightClick']
from
StateNode
onTick?: TLEventHandlers['onTick']
onTripleClick: TLClickEvent
from
StateNode
onWheel?: TLEventHandlers['onWheel']
from
StateNode
parent: StateNode
from
StateNode
performanceTracker: PerformanceTracker
from
StateNode
shapeType?: string
from
StateNode
Transition to a new active child state node.
transition: (id: string, info?: any) => this
Example
parentState.transition('childStateA')
parentState.transition('childStateB', { myData: 4 })
Parameters
Name | Description |
---|---|
| The id of the child state node to transition to. |
| Any data to pass to the |
from
StateNode
type: 'branch' | 'leaf' | 'root'
Methods
from
StateNode
This node's current active child node, if any.
getCurrent(): StateNode | undefined
from
StateNode
getCurrentToolIdMask(): string | undefined
from
StateNode
Whether this node is active.
getIsActive(): boolean
from
StateNode
This node's path of active state nodes
getPath(): string
from
StateNode
setCurrentToolIdMask(id: string | undefined): void
Parameters
Name | Description |
---|---|
|
|
Returns
void