Standardize default position arguments across constructors #101

Closed
opened 2025-07-05 19:10:17 +00:00 by john · 1 comment
Owner

Some objects default position to (0,0), others require it. All position arguments should be optional with (0,0) default for consistency.
Affects: Frame, Caption, Sprite, Grid, Entity

Some objects default position to (0,0), others require it. All position arguments should be optional with (0,0) default for consistency. Affects: Frame, Caption, Sprite, Grid, Entity
Author
Owner

Entity uses grid_pos instead of pos for the keyword argument:

Type Keyword Works?
Frame pos=(x,y)
Caption pos=(x,y)
Sprite pos=(x,y)
Grid pos=(x,y)
Entity pos=(x,y) "unexpected keyword argument 'pos'"
Entity grid_pos=(x,y)

Entity uses grid_pos because it's tile coordinates on a grid, rather than pixel coordinates on the screen or relative to a parent.

Entity uses grid_pos instead of pos for the keyword argument: | Type | Keyword | Works? | |---------|----------------|----------------------------------------| | Frame | pos=(x,y) | ✅ | | Caption | pos=(x,y) | ✅ | | Sprite | pos=(x,y) | ✅ | | Grid | pos=(x,y) | ✅ | | Entity | pos=(x,y) | ❌ "unexpected keyword argument 'pos'" | | Entity | grid_pos=(x,y) | ✅ | Entity uses `grid_pos` because it's tile coordinates on a grid, rather than pixel coordinates on the screen or relative to a parent.
john closed this issue 2025-12-28 16:25:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#101
No description provided.