Add compound Color and Vector animation targets (pos, fill_color), closes #218

UIFrame, UICaption, and UISprite now accept "pos" as an alias for "position"
in the animation property system. UICaption and UISprite gain Vector2f
setProperty/getProperty overrides enabling animate("pos", (x, y), duration).
Color compound animation (fill_color, outline_color) was already supported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John McCardle 2026-04-10 02:05:55 -04:00
commit 061b29a07a
6 changed files with 144 additions and 6 deletions

View file

@ -924,7 +924,7 @@ bool UIFrame::setProperty(const std::string& name, const sf::Color& value) {
}
bool UIFrame::setProperty(const std::string& name, const sf::Vector2f& value) {
if (name == "position") {
if (name == "position" || name == "pos") {
position = value;
box.setPosition(position); // Keep box in sync
markDirty();
@ -1019,7 +1019,7 @@ bool UIFrame::getProperty(const std::string& name, sf::Color& value) const {
}
bool UIFrame::getProperty(const std::string& name, sf::Vector2f& value) const {
if (name == "position") {
if (name == "position" || name == "pos") {
value = position;
return true;
} else if (name == "size") {
@ -1048,7 +1048,7 @@ bool UIFrame::hasProperty(const std::string& name) const {
return true;
}
// Vector2f properties
if (name == "position" || name == "size" || name == "origin") {
if (name == "position" || name == "pos" || name == "size" || name == "origin") {
return true;
}
// #106: Check for shader uniform properties