Entities have grid_pos initializer argument, but pos property #176
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.
Dependencies
No dependencies set.
Reference
john/McRogueFace#176
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?
could probably dig up a lot of history behind this problem and if
posvsgrid_posis worth the headache to distinguish, but regardless, I don't think the inconsistency is appropriate. I'm leaning towards making PyEntity usegrid_posas the property name.Implementation Complete
Resolved the Entity position naming inconsistency with a three-tier coordinate system:
New Entity Properties
pos,x,ygrid_pos,grid_x,grid_ydraw_posKey Features
pos/x/y(pixels) - Computed asdraw_pos * tile_sizeRuntimeErrorotherwise)caption.pos = entity.posgrid_pos/grid_x/grid_y(tiles) - Integer tile coordinatesgrid_posconstructor argumentdraw_pos(fractional tiles) - For smooth animationentity.animate("draw_x", 5.0, 1.0)Animation Changes
Animation property names updated for clarity:
draw_x,draw_y- Preferred names for tile coordinate animationx,y- Kept as aliases for backwards compatibilityFiles Changed
src/UIEntity.h- Added new getter/setter declarations, updated docstringsrc/UIEntity.cpp- Implemented pixel position getters/setters, updated getsetters array, updated repr to showgrid_x/grid_yTest
New test:
tests/issue_176_entity_position_test.py