UI animation engine

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

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

Postby CrazyEddie » Mon Nov 10, 2008 10:13

Glad it's helpful :)

haihuojiming
Just popping in
Just popping in
Posts: 10
Joined: Tue Jul 01, 2008 07:57

Postby haihuojiming » Thu Nov 20, 2008 12:18

thanks for sharing this code. it's very useful

kili
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Fri Apr 27, 2007 06:17

Postby kili » Fri Dec 26, 2008 09:45

Code: Select all

bool UIAnimationManager::addWindow(CEGUI::Window *window, const std::string &id, const std::string &animationName)
{

  _windowDefaults[id].getScalarProperties().push_back(CEGUIProperty("Text", window->getProperty("Visible").c_str()));

}


Visible should be Text... :oops:

songge3604
Quite a regular
Quite a regular
Posts: 60
Joined: Tue Oct 28, 2008 10:46

Postby songge3604 » Tue Apr 14, 2009 05:58

There is no acceleration and callback in uiae.

no callback for example:

when the front window fade out, the back window fade in, the front window's alpha is 0, but it also cover the back window, so I need set the front window hide, so I need a callback when the animation end.

songge3604
Quite a regular
Quite a regular
Posts: 60
Joined: Tue Oct 28, 2008 10:46

Postby songge3604 » Tue Apr 14, 2009 05:58

Can you solve problems like this?

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

Postby CrazyEddie » Tue Apr 14, 2009 09:15

I'm not certain (not my product ;)), but what you could perhaps do is set up an action that sets the 'Visible' property once the fade is completed? Not certain how you'd do it, but I'd bet it's possible somehow :)

CE.

h.a.n.d
Just popping in
Just popping in
Posts: 1
Joined: Fri Aug 07, 2009 14:56

Re: UI animation engine

Postby h.a.n.d » Fri Aug 07, 2009 16:46

Hi Everyone,

I came around this thread some days ago in the search of an animation class for CEGUI.
So I tested this usefull engine and added some new stuff to it:

The main changes are:

An animation queue to build an animation chain.
I.E.:
1. Animate window A
(if finished)
2. Animate window B
...

A callback functionality, which I borrowed, with little changes, from the CEGUI lib ;-).

Example:

Code: Select all

class MyClass {

public:


MyClass(){};
~MyClass(){};

//CEGUI Windows
CEGUI::Window* mWindowA;
CEGUI::Window* mWindowB;

UIAE::UIAnimationManager* mGUIAnimatorManager;

void setup()
{

   mGUIAnimatorManager = UIAE::UIAnimationManager::instance();
   
   if (mGUIAnimatorManager->loadAnimationsFromFile("GUIAnimations.xml")) {
      mAnimateGUI = true;
      setupWindowAnimations();
   }

}

void setupWindowAnimations()
{

   //Adding the Windows to the AnimationManager
   mGUIAnimatorManager->addWindow(mWindowA, mWindowA->getName().c_str(), "misc");
   mGUIAnimatorManager->addWindow(mWindowB, mWindowB->getName().c_str(), "misc");
   
   //Binding a callback function to the "hide" animation
   mGUIAnimatorManager->subscribeCallback(mWindowA->getName().c_str(), "hide", UIAE::Callback(&hide, this));

}

bool hide(const CEGUI::EventArgs& args)
{
   mWindowA->setVisible(false);
   mWindowB->setVisible(true);

   return true;
}

void animateWindowA()
{

   mGUIAnimatorManager->animate((mWindowA->getName().c_str(),"hide");
}

void animateWindowAB()
{
   UIAE::AnimationPairList animations;

   animations.push_back(UIAE::AnimationPair(mWindowA->getName().c_str(),"hide"));
   animations.push_back(UIAE::AnimationPair(mWindowB->getName().c_str(),"show"));


   mGUIAnimatorManager->animate(animations);
}

};



Please read the readmeto.txt for detailed information.

I hope you'll find some use for it and keep sharing! :!:

For CEGUI Version 0.6

http://rapidshare.com/files/265654602/CEGUI-UIAE-0.4.0.zip.html

Mirror:
http://bubbleworld.co.cc/CEGUI-UIAE-0.4.0.zip

h.a.n.d
Last edited by h.a.n.d on Fri Aug 14, 2009 17:30, edited 5 times in total.

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

Re: UI animation engine

Postby CrazyEddie » Sat Aug 08, 2009 08:29

Cool, it sounds like some good enhancements :) The link to the file however does not function for me :(

CE.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests