Play an animation backward

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

mattekenpis
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 23, 2013 12:35

Play an animation backward

Postby mattekenpis » Fri Feb 01, 2013 10:53

Hi!

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Play an animation backward

Postby CrazyEddie » Mon Feb 04, 2013 09:09

We don't currently have a 'backwards' option for animations, so what you're doing is about the best you can do. Please add a mantis ticket (http://mantis.cegui.org.uk/ and use your forum login) to request a backwards option for animations :D

CE.

mattekenpis
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 23, 2013 12:35

Re: Play an animation backward

Postby mattekenpis » Mon Feb 04, 2013 15:41

Thanx for the answer Eddy.

I posted a ticket on MantisBT. Indeed I posted an "issue" because I didn't found any button "ask feature"... Is it ok?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Play an animation backward

Postby CrazyEddie » Sat Feb 09, 2013 08:51

Yeah, all tickets are 'issues' or 'bugs' - it's just what mantis calls them. Thanks :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 28 guests