LevelToolHandler class abstract
A viewport tool: something that interprets pointer drags as an edit.
Tools own no state that outlives a gesture beyond what they need to track the drag in progress, and they never paint directly — they describe what should be drawn through LevelDesignerController so all designer painting stays on the single canvas pass the plugin owns.
A tool is identified by a plain string rather than an enum value, so a project can add one without the editor package having to know it exists. The palette renders whatever is registered, using the metadata below.
Constructors
Properties
- acceptsSecondaryButton → bool
-
Whether a right-button press is this tool's. Otherwise it opens the
viewport's context menu, which Shift+right-click always does.
no setter
- description → String?
-
Longer explanation for the tooltip.
no setter
- dimensions → Dimensions
-
Which scene modes the palette offers it in. 2-D unless it says
otherwise: tools work in 2-D world points.
no setter
- group → String
-
Which part of the strip it sits in: one of ToolGroups, or a group of
a module's own (
EditorModule.toolGroups). The strip captions each group.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData
-
Palette icon.
no setter
- id → String
-
Stable identifier, e.g.
'select'or'platformer.path'.no setter - label → String
-
Short palette label.
no setter
- order → int
-
Palette ordering. Lower sorts first.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shortcut → String?
-
Single-key shortcut, shown in the tooltip. Null for no shortcut.
no setter
Methods
-
buildOptions(
BuildContext context, ToolOptionsContext options) → Widget? - The tool's settings — modes, sizes, switches — for the left of the designer's status bar. Null when it has none; the bar then says what the tool does.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onActivate(
) → void - Became the active tool.
-
onCancel(
) → void - Gesture abandoned (pointer cancelled, tool switched). Discard any in-progress state without committing.
-
onDeactivate(
) → void - Stopped being the active tool.
-
onKey(
LogicalKeyboardKey key, ToolContext context) → bool -
A key pressed while this tool is active, before the designer's own
commands and the editor's. Return true to keep it.
contextis at the pointer's last position. -
onPointerDown(
ToolContext context) → bool - Pointer pressed. Return true to claim the gesture; returning false lets the default gizmo handling take over.
-
onPointerExit(
) → void - Pointer left the viewport.
-
onPointerHover(
ToolContext context) → void - Pointer moved with no button down — for showing what a click would do, like a brush under the cursor.
-
onPointerMove(
ToolContext context) → void - Pointer moved while the gesture is active.
-
onPointerUp(
ToolContext context) → void - Pointer released — commit the edit here, as one undoable command.
-
onScroll(
ToolContext context, Offset delta) → bool -
The wheel turned by
deltaover the viewport while this tool is active, before the view zooms: return true to keep it — Place spins what it is about to place while Shift is held. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited