ToolManager
ToolManager handles tool registration, activation, and event routing.
| Method | Description |
|---|---|
registerTool(definition) | Register a tool definition |
setCurrentTool(id) | Activate a tool by ID |
getCurrentToolId() | Get the active tool ID |
ToolDefinition
| Property | Description |
|---|---|
id | Unique tool identifier |
initialStateId | The state to enter when the tool activates |
stateConstructors | Factory functions that create StateNode instances |
ToolId
StateNode
TheStateNode base class defines the interface that every tool state must implement.
| Method | Receives | Description |
|---|---|---|
onEnter(info) | ToolStateTransitionInfo | Called when entering this state |
onExit(info) | ToolStateTransitionInfo | Called when leaving this state |
onPointerDown(info) | ToolPointerDownInfo | Pointer pressed |
onPointerMove(info) | ToolPointerMoveInfo | Pointer moved |
onPointerUp(info) | ToolPointerMoveInfo | Pointer released |
onKeyDown(info) | ToolKeyInfo | Key pressed |
onKeyUp(info) | ToolKeyInfo | Key released |