Standardize sprite_index property and add scale_x/scale_y to UISprite
closes #81, closes #82 - Issue #81: Standardized property name to sprite_index across UISprite and UIEntity - Added sprite_index as the primary property name - Kept sprite_number as a deprecated alias for backward compatibility - Updated repr() methods to use sprite_index - Updated animation system to recognize both names - Issue #82: Added scale_x and scale_y properties to UISprite - Enables non-uniform scaling of sprites - scale property still works for uniform scaling - Both properties work with the animation system All existing code using sprite_number continues to work due to backward compatibility.
This commit is contained in:
parent
5a003a9aa5
commit
2f2b488fb5
5 changed files with 420 additions and 11 deletions
|
|
@ -90,8 +90,8 @@ void Animation::startEntity(UIEntity* target) {
|
|||
}
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, int>) {
|
||||
// For entities, we might need to handle sprite_number differently
|
||||
if (targetProperty == "sprite_number") {
|
||||
// For entities, we might need to handle sprite_index differently
|
||||
if (targetProperty == "sprite_index" || targetProperty == "sprite_number") {
|
||||
startValue = target->sprite.getSpriteIndex();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue