Is there a possibilty to play an animation forward sometimes, and some other times backward, but with only one definition in the .animation xml file?
for the moment I do like this:
Code: Select all
<!-- Forward -->
<AnimationDefinition name="Fold" duration="0.2" replayMode="once">
<Affector property="UnifiedXPosition" interpolator="UDim">
<KeyFrame position="0.0" value="{0,0}" />
<KeyFrame position="0.2" value="{0,-200}" />
</Affector>
</AnimationDefinition>
<!-- Backward-->
<AnimationDefinition name="Unfold" duration="0.2" replayMode="once">
<Affector property="UnifiedXPosition" interpolator="UDim">
<KeyFrame position="0.0" value="{0,-200}" />
<KeyFrame position="0.2" value="{0,0}" />
</Affector>
</AnimationDefinition>
and the lua code:
Code: Select all
-- Animation Instancing
m_foldAnim = animationMgr:instantiateAnimation("Fold");
m_foldlAnim:setTargetWindow(myWindow);
m_unfoldAnim = animationMgr:instantiateAnimation("Unfold");
m_unfoldAnim:setTargetWindow(myWindow);
--and to start the animations
m_unfoldAnim:start()
-- or
m_foldAnim :start()
Is there a way to factorize both animations in one, and to play "forward" or "backward"?
I could't manage to find such a mechanism in the CEGUI library reference....
Thanx in advance for the help