mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-27 02:05:06 +01:00
Added animation support for containerX, containerY, containerWidth, and containerHeight.
This commit is contained in:
parent
a3318ee1d5
commit
d1263ccc92
@ -54,6 +54,10 @@ bool Tween::getTweenProperty(std::string name, TweenProperty &property)
|
||||
tweenPropertyMap_["maxwidth"] = TWEEN_PROPERTY_MAX_WIDTH;
|
||||
tweenPropertyMap_["maxheight"] = TWEEN_PROPERTY_MAX_HEIGHT;
|
||||
tweenPropertyMap_["layer"] = TWEEN_PROPERTY_LAYER;
|
||||
tweenPropertyMap_["containerx"] = TWEEN_PROPERTY_CONTAINER_X;
|
||||
tweenPropertyMap_["containery"] = TWEEN_PROPERTY_CONTAINER_Y;
|
||||
tweenPropertyMap_["containerwidth"] = TWEEN_PROPERTY_CONTAINER_WIDTH;
|
||||
tweenPropertyMap_["containerheight"] = TWEEN_PROPERTY_CONTAINER_HEIGHT;
|
||||
tweenPropertyMap_["nop"] = TWEEN_PROPERTY_NOP;
|
||||
}
|
||||
|
||||
|
||||
@ -58,5 +58,9 @@ enum TweenProperty
|
||||
TWEEN_PROPERTY_MAX_WIDTH,
|
||||
TWEEN_PROPERTY_MAX_HEIGHT,
|
||||
TWEEN_PROPERTY_LAYER,
|
||||
TWEEN_PROPERTY_CONTAINER_X,
|
||||
TWEEN_PROPERTY_CONTAINER_Y,
|
||||
TWEEN_PROPERTY_CONTAINER_WIDTH,
|
||||
TWEEN_PROPERTY_CONTAINER_HEIGHT,
|
||||
TWEEN_PROPERTY_NOP,
|
||||
};
|
||||
|
||||
@ -309,6 +309,34 @@ bool Component::animate()
|
||||
baseViewInfo.Layer = static_cast<unsigned int>(tween->animate(elapsedTime, storeViewInfo_.Layer));
|
||||
break;
|
||||
|
||||
case TWEEN_PROPERTY_CONTAINER_X:
|
||||
if (tween->startDefined)
|
||||
baseViewInfo.ContainerX = tween->animate(elapsedTime);
|
||||
else
|
||||
baseViewInfo.ContainerX = tween->animate(elapsedTime, storeViewInfo_.ContainerX);
|
||||
break;
|
||||
|
||||
case TWEEN_PROPERTY_CONTAINER_Y:
|
||||
if (tween->startDefined)
|
||||
baseViewInfo.ContainerY = tween->animate(elapsedTime);
|
||||
else
|
||||
baseViewInfo.ContainerY = tween->animate(elapsedTime, storeViewInfo_.ContainerY);
|
||||
break;
|
||||
|
||||
case TWEEN_PROPERTY_CONTAINER_WIDTH:
|
||||
if (tween->startDefined)
|
||||
baseViewInfo.ContainerWidth = tween->animate(elapsedTime);
|
||||
else
|
||||
baseViewInfo.ContainerWidth = tween->animate(elapsedTime, storeViewInfo_.ContainerWidth);
|
||||
break;
|
||||
|
||||
case TWEEN_PROPERTY_CONTAINER_HEIGHT:
|
||||
if (tween->startDefined)
|
||||
baseViewInfo.ContainerHeight = tween->animate(elapsedTime);
|
||||
else
|
||||
baseViewInfo.ContainerHeight = tween->animate(elapsedTime, storeViewInfo_.ContainerHeight);
|
||||
break;
|
||||
|
||||
case TWEEN_PROPERTY_NOP:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1162,6 +1162,8 @@ void PageBuilder::getAnimationEvents(xml_node<> *node, TweenSet &tweens)
|
||||
case TWEEN_PROPERTY_WIDTH:
|
||||
case TWEEN_PROPERTY_X:
|
||||
case TWEEN_PROPERTY_X_OFFSET:
|
||||
case TWEEN_PROPERTY_CONTAINER_X:
|
||||
case TWEEN_PROPERTY_CONTAINER_WIDTH:
|
||||
fromValue = getHorizontalAlignment(from, 0);
|
||||
toValue = getHorizontalAlignment(to, 0);
|
||||
break;
|
||||
@ -1176,6 +1178,8 @@ void PageBuilder::getAnimationEvents(xml_node<> *node, TweenSet &tweens)
|
||||
case TWEEN_PROPERTY_Y:
|
||||
case TWEEN_PROPERTY_Y_OFFSET:
|
||||
case TWEEN_PROPERTY_FONT_SIZE:
|
||||
case TWEEN_PROPERTY_CONTAINER_Y:
|
||||
case TWEEN_PROPERTY_CONTAINER_HEIGHT:
|
||||
fromValue = getVerticalAlignment(from, 0);
|
||||
toValue = getVerticalAlignment(to, 0);
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user