Namespace MoonBark.GridPlacement.Godot.Cursor
Classes
- Cursor2D
Godot Node2D that tracks the cursor position on a grid and forwards input to the IPlacementInputBridge entirely through configurable Input Map actions.
All input is driven by CursorInputSettings actions — no hardcoded mouse buttons or keycodes.
Input action contract
- ConfirmAction (press & hold) Press → start drag + SetDragActive(true). Hold + move → auto-place on each tile change. Release → SetDragActive(false).
- ConfirmAction (tap) Tap (press & release without moving) → emit ConfirmPressed. PlacementInputController routes this to ExecutePlacement().
- CancelAction Emit CancelPressed. Routed by PlacementInputController to CancelPlacement().
- Directional actions (Up/Down/Left/Right) Move cursor one tile per press, with repeat when held.
Drag-to-place flow (press & hold confirm)
Press ConfirmAction → SetDragActive(true) → Move to new tile → _Process() detects tile change → Emit GridPositionChanged(gridPos) → Auto-calls ExecutePlacement() for each new tile → Repeat move → auto-place while held Release ConfirmAction → SetDragActive(false)Tap-to-place flow
Tap ConfirmAction (no movement between press and release) → Emit ConfirmPressed → PlacementInputController calls ExecutePlacement()
- Cursor2D.MethodName
Cached StringNames for the methods contained in this class, for fast lookup.
- Cursor2D.PropertyName
Cached StringNames for the properties and fields contained in this class, for fast lookup.
- Cursor2D.SignalName
Cached StringNames for the signals contained in this class, for fast lookup.
- CursorInputSettings
Configures input action names and behavior for Cursor2D. Expose as a Godot.Resource in the inspector to tweak without code changes.
Default values match the Godot input map conventions used in demo scenes: cursor_up, cursor_down, cursor_left, cursor_right, cursor_confirm, cursor_cancel.
- CursorInputSettings.MethodName
Cached StringNames for the methods contained in this class, for fast lookup.
- CursorInputSettings.PropertyName
Cached StringNames for the properties and fields contained in this class, for fast lookup.
- CursorInputSettings.SignalName
Cached StringNames for the signals contained in this class, for fast lookup.
Delegates
- Cursor2D.CancelPressedEventHandler
Emitted when the cancel input action is pressed (Escape / configured action). Connect to PlacementInputController which routes it to the bridge.
- Cursor2D.ConfirmPressedEventHandler
Emitted when the confirm input action is pressed (Enter / numpad Enter / configured action). Connect to PlacementInputController which routes it to the bridge.
- Cursor2D.GridPositionChangedEventHandler
Emitted whenever the grid position changes to a different tile.