Grid Cell Mouse Events #142
Labels
No Label
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: john/McRogueFace#142
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Grid-level callbacks for mouse interaction with individual cells.
Context
Games need to know which grid cell the mouse is over for:
Events are at the Grid level, not per-cell (per-cell would be enormously heavyweight).
Definition of Done
Callbacks
grid.on_cell_enter- called with(cell_x, cell_y)when mouse enters a new cellgrid.on_cell_exit- called with(cell_x, cell_y)when mouse leaves a cellgrid.on_cell_click- called with(cell_x, cell_y)when cell is clickedQueryable State
grid.hovered_cellproperty →(cell_x, cell_y)tuple orNoneif mouse not over gridEdge Cases
hovered_cell = None, no cell eventshovered_cell = NoneTechnical Notes
Coordinate Transformation
Grid has complex coordinate system:
grid.centeris in grid-space pixel coordinatesC++ must transform screen coords → grid-space → cell coords:
State Tracking (C++ side)
Callback Validation
Apply same signature checking as other callbacks:
Example Usage
Dependencies
Related Issues