diff --git a/RetroFE/Source/Graphics/Animate/Tween.cpp b/RetroFE/Source/Graphics/Animate/Tween.cpp index 73f73a8..fdba7f0 100755 --- a/RetroFE/Source/Graphics/Animate/Tween.cpp +++ b/RetroFE/Source/Graphics/Animate/Tween.cpp @@ -49,6 +49,7 @@ bool Tween::getTweenProperty(std::string name, TweenProperty &property) tweenPropertyMap_["yorigin"] = TWEEN_PROPERTY_Y_ORIGIN; tweenPropertyMap_["xoffset"] = TWEEN_PROPERTY_X_OFFSET; tweenPropertyMap_["yoffset"] = TWEEN_PROPERTY_Y_OFFSET; + tweenPropertyMap_["xoffsetshiftmenudirection"] = TWEEN_PROPERTY_X_OFFSET_SHIFT_MENU_DIRECTION; tweenPropertyMap_["yoffsetshiftmenudirection"] = TWEEN_PROPERTY_Y_OFFSET_SHIFT_MENU_DIRECTION; tweenPropertyMap_["fontSize"] = TWEEN_PROPERTY_FONT_SIZE; tweenPropertyMap_["backgroundalpha"] = TWEEN_PROPERTY_BACKGROUND_ALPHA; @@ -78,27 +79,27 @@ TweenAlgorithm Tween::getTweenType(std::string name) { if(tweenTypeMap_.size() == 0) { - tweenTypeMap_["easeInquadratic"] = EASE_IN_QUADRATIC; - tweenTypeMap_["easeOutquadratic"] = EASE_OUT_QUADRATIC; - tweenTypeMap_["easeInoutquadratic"] = EASE_INOUT_QUADRATIC; - tweenTypeMap_["easeIncubic"] = EASE_IN_CUBIC; - tweenTypeMap_["easeOutcubic"] = EASE_OUT_CUBIC; - tweenTypeMap_["easeInoutcubic"] = EASE_INOUT_CUBIC; - tweenTypeMap_["easeInquartic"] = EASE_IN_QUARTIC; - tweenTypeMap_["easeOutquartic"] = EASE_OUT_QUARTIC; - tweenTypeMap_["easeInoutquartic"] = EASE_INOUT_QUARTIC; - tweenTypeMap_["easeInquintic"] = EASE_IN_QUINTIC; - tweenTypeMap_["easeOutquintic"] = EASE_OUT_QUINTIC; - tweenTypeMap_["easeInoutquintic"] = EASE_INOUT_QUINTIC; - tweenTypeMap_["easeInsine"] = EASE_IN_SINE; - tweenTypeMap_["easeOutsine"] = EASE_OUT_SINE; - tweenTypeMap_["easeInoutsine"] = EASE_INOUT_SINE; - tweenTypeMap_["easeInexponential"] = EASE_IN_EXPONENTIAL; - tweenTypeMap_["easeOutexponential"] = EASE_OUT_EXPONENTIAL; - tweenTypeMap_["easeInoutexponential"] = EASE_INOUT_EXPONENTIAL; - tweenTypeMap_["easeIncircular"] = EASE_IN_CIRCULAR; - tweenTypeMap_["easeOutcircular"] = EASE_OUT_CIRCULAR; - tweenTypeMap_["easeInoutcircular"] = EASE_INOUT_CIRCULAR; + tweenTypeMap_["easeinquadratic"] = EASE_IN_QUADRATIC; + tweenTypeMap_["easeoutquadratic"] = EASE_OUT_QUADRATIC; + tweenTypeMap_["easeinoutquadratic"] = EASE_INOUT_QUADRATIC; + tweenTypeMap_["easeincubic"] = EASE_IN_CUBIC; + tweenTypeMap_["easeoutcubic"] = EASE_OUT_CUBIC; + tweenTypeMap_["easeinoutcubic"] = EASE_INOUT_CUBIC; + tweenTypeMap_["easeinquartic"] = EASE_IN_QUARTIC; + tweenTypeMap_["easeoutquartic"] = EASE_OUT_QUARTIC; + tweenTypeMap_["easeinoutquartic"] = EASE_INOUT_QUARTIC; + tweenTypeMap_["easeinquintic"] = EASE_IN_QUINTIC; + tweenTypeMap_["easeoutquintic"] = EASE_OUT_QUINTIC; + tweenTypeMap_["easeinoutquintic"] = EASE_INOUT_QUINTIC; + tweenTypeMap_["easeinsine"] = EASE_IN_SINE; + tweenTypeMap_["easeoutsine"] = EASE_OUT_SINE; + tweenTypeMap_["easeinoutsine"] = EASE_INOUT_SINE; + tweenTypeMap_["easeinexponential"] = EASE_IN_EXPONENTIAL; + tweenTypeMap_["easeoutexponential"] = EASE_OUT_EXPONENTIAL; + tweenTypeMap_["easeinoutexponential"] = EASE_INOUT_EXPONENTIAL; + tweenTypeMap_["easeincircular"] = EASE_IN_CIRCULAR; + tweenTypeMap_["easeoutcircular"] = EASE_OUT_CIRCULAR; + tweenTypeMap_["easeinoutcircular"] = EASE_INOUT_CIRCULAR; tweenTypeMap_["linear"] = LINEAR; } diff --git a/RetroFE/Source/Graphics/Animate/TweenTypes.h b/RetroFE/Source/Graphics/Animate/TweenTypes.h index e370d2c..c25287d 100755 --- a/RetroFE/Source/Graphics/Animate/TweenTypes.h +++ b/RetroFE/Source/Graphics/Animate/TweenTypes.h @@ -53,6 +53,7 @@ enum TweenProperty TWEEN_PROPERTY_Y_ORIGIN, TWEEN_PROPERTY_X_OFFSET, TWEEN_PROPERTY_Y_OFFSET, + TWEEN_PROPERTY_X_OFFSET_SHIFT_MENU_DIRECTION, TWEEN_PROPERTY_Y_OFFSET_SHIFT_MENU_DIRECTION, TWEEN_PROPERTY_FONT_SIZE, TWEEN_PROPERTY_BACKGROUND_ALPHA, diff --git a/RetroFE/Source/Graphics/Component/Component.cpp b/RetroFE/Source/Graphics/Component/Component.cpp index edbe2af..268b2a0 100755 --- a/RetroFE/Source/Graphics/Component/Component.cpp +++ b/RetroFE/Source/Graphics/Component/Component.cpp @@ -345,6 +345,21 @@ bool Component::animate() baseViewInfo.YOffset = tween->animate(elapsedTime, storeViewInfo_.YOffset); break; + case TWEEN_PROPERTY_X_OFFSET_SHIFT_MENU_DIRECTION: + if (tween->startDefined){ + baseViewInfo.XOffset = tween->animate(elapsedTime, + tween->getStart(), + tween->getStart() + tween->getEnd()* (static_cast(page.isMenuScrollForward()?-1.0f:1.0f)), + duration); + } + else{ + baseViewInfo.XOffset = tween->animate(elapsedTime, + static_cast(storeViewInfo_.YOffset), + static_cast(storeViewInfo_.YOffset) + tween->getEnd()* (static_cast(page.isMenuScrollForward()?-1.0f:1.0f)), + duration); + } + break; + case TWEEN_PROPERTY_Y_OFFSET_SHIFT_MENU_DIRECTION: if (tween->startDefined){ /*printf("storeViewInfo_.YOffset = %f, tween->start() = %f, page.isMenuScrollForward()=%d, tween->getEnd()=%f, newEnd=%f\n", diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index a3b2f2a..b4665c1 100755 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -1492,7 +1492,7 @@ void PageBuilder::getAnimationEvents(xml_node<> *node, TweenSet &tweens) if(algorithmXml) { algorithm = Tween::getTweenType(algorithmXml->value()); - + //printf(" algorithm=%d\n", algorithm); } if(Tween::getTweenProperty(type->value(), property)) @@ -1524,6 +1524,7 @@ void PageBuilder::getAnimationEvents(xml_node<> *node, TweenSet &tweens) toValue = getVerticalAlignment(to, 0); break; + case TWEEN_PROPERTY_X_OFFSET_SHIFT_MENU_DIRECTION: case TWEEN_PROPERTY_Y_OFFSET_SHIFT_MENU_DIRECTION: fromValue = getVerticalAlignment(from, 0); toValue = getVerticalAlignment(to, 0);