Entity origin offset for oversized sprites #234
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
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 participant
Notifications
Due date
No due date set.
Blocks
#233 Enhance Entity rendering and positioning capabilities
john/McRogueFace
Reference
john/McRogueFace#234
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
Allow entities to specify a pixel offset from their tile position, enabling sprites taller/wider than the grid cell size to be properly positioned.
Parent issue: #233
Use Case
A 16×24 character sprite on a 16×16 grid should render with the sprite's "feet" at the tile position, not the top of the sprite. This requires an origin offset of (0, -8) or equivalent.
Current Behavior
Entity pixel position is calculated as:
No offset is applied - sprite top-left aligns exactly with tile top-left.
Proposed Changes
Add to UIEntity:
Modify grid rendering:
Expose to Python:
Performance Impact
Negligible - one vector addition per entity during render.
Files Affected
src/UIEntity.h- Add render_offset propertysrc/UIEntity.cpp- Add Python getters/setterssrc/UIGrid.cpp:242-244- Apply offset during rendering