Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::Animation Class Reference

Defines an 'animation' class. More...

+ Inheritance diagram for CEGUI::Animation:
+ Collaboration diagram for CEGUI::Animation:

Public Types

enum  ReplayMode { RM_Once, RM_Loop, RM_Bounce }
 enumerates possible replay modes More...
 

Public Member Functions

 Animation (const String &name)
 
 ~Animation (void)
 destructor, this destroys all affectors defined inside this animation
 
const StringgetName () const
 Retrieves name of this Animation definition.
 
void setReplayMode (ReplayMode mode)
 Sets the replay mode of this animation.
 
ReplayMode getReplayMode () const
 Retrieves the replay mode of this animation.
 
void setDuration (float duration)
 Sets the duration of this animation.
 
float getDuration () const
 Retrieves the duration of this animation.
 
void setAutoStart (bool autoStart)
 Sets whether this animation auto starts or not. More...
 
bool getAutoStart () const
 Retrieves auto start. More...
 
AffectorcreateAffector (void)
 Creates a new Affector. More...
 
AffectorcreateAffector (const String &targetProperty, const String &interpolator)
 Creates a new Affector. More...
 
void destroyAffector (Affector *affector)
 Destroys given Affector.
 
AffectorgetAffectorAtIdx (size_t index) const
 Retrieves the Affector at given index.
 
size_t getNumAffectors (void) const
 Retrieves number of Affectors defined in this Animation.
 
void defineAutoSubscription (const String &eventName, const String &action)
 This defined a new auto subscription. More...
 
void undefineAutoSubscription (const String &eventName, const String &action)
 This undefines previously defined auto subscription. More...
 
void undefineAllAutoSubscriptions ()
 This undefines all previously defined auto subscriptions. More...
 
void autoSubscribe (AnimationInstance *instance)
 Subscribes all auto subscriptions with information from given animation instance. More...
 
void autoUnsubscribe (AnimationInstance *instance)
 Unsubscribes all auto subscriptions with information from given animation instance. More...
 
void savePropertyValues (AnimationInstance *instance)
 Internal method, causes all properties that are used by this animation and it's affectors to be saved. More...
 
void apply (AnimationInstance *instance)
 Applies this Animation definition using information from given AnimationInstance. More...
 
void writeXMLToStream (XMLSerializer &xml_stream, const String &name_override="") const
 Writes an xml representation of this Animation definition to out_stream. More...
 

Detailed Description

Defines an 'animation' class.

This is definition of Animation. Can be reused multiple times via
AnimationInstance class. You can't step this class directly, you have to
instantiate it via AnimationManager::instantiateAnimation.

AnimationInstance provides means for stepping the animation and applying
it to PropertySets.
Animation itself doesn't contain key frames. It is composed of Affector(s). Each Affector affects one Property. So one Animation can affect multiple properties.
See Also
AnimationInstance, Affector

Member Enumeration Documentation

enumerates possible replay modes

Enumerator
RM_Once 

plays the animation just once, then stops

RM_Loop 

loops the animation infinitely

RM_Bounce 

infinitely plays the animation forward, when it reaches the end, it plays it backwards, etc...

Constructor & Destructor Documentation

CEGUI::Animation::Animation ( const String name)

internal constructor, please only construct animations via AnimationManager::createAnimation method

Member Function Documentation

void CEGUI::Animation::apply ( AnimationInstance instance)

Applies this Animation definition using information from given AnimationInstance.

This is internal method, only use if you know what you're doing!
void CEGUI::Animation::autoSubscribe ( AnimationInstance instance)

Subscribes all auto subscriptions with information from given animation instance.

This is internal method! Only use if you know what you're doing!
void CEGUI::Animation::autoUnsubscribe ( AnimationInstance instance)

Unsubscribes all auto subscriptions with information from given animation instance.

This is internal method! Only use if you know what you're doing!
Affector* CEGUI::Animation::createAffector ( void  )

Creates a new Affector.

See Also
Affector
Affector* CEGUI::Animation::createAffector ( const String targetProperty,
const String interpolator 
)

Creates a new Affector.

This is just a helper, finger saving method.
void CEGUI::Animation::defineAutoSubscription ( const String eventName,
const String action 
)

This defined a new auto subscription.

Parameters
eventNamethe name of the event we want to subscribe to, CEGUI::Window::EventClicked for example
actionis the action that will be invoked on the animation instance if this event is fired
Auto Subscription does subscribe to event sender (usually target window) of Animation Instance when the event source is set.

Usable action strings:

  • Start
  • Stop
  • Pause
  • Unpause
  • TogglePause

eventName is the name of the event we want to subscribe to

bool CEGUI::Animation::getAutoStart ( ) const

Retrieves auto start.

See Also
Animation::setAutoStart
void CEGUI::Animation::savePropertyValues ( AnimationInstance instance)

Internal method, causes all properties that are used by this animation and it's affectors to be saved.

So their values are still known after they've been affected.
void CEGUI::Animation::setAutoStart ( bool  autoStart)

Sets whether this animation auto starts or not.

Auto start means that the animation instances of this definition call Start on themselves once their target is set.
void CEGUI::Animation::undefineAllAutoSubscriptions ( )

This undefines all previously defined auto subscriptions.

See Also
Animation::defineAutoSubscription
void CEGUI::Animation::undefineAutoSubscription ( const String eventName,
const String action 
)

This undefines previously defined auto subscription.

See Also
Animation::defineAutoSubscription
void CEGUI::Animation::writeXMLToStream ( XMLSerializer xml_stream,
const String name_override = "" 
) const

Writes an xml representation of this Animation definition to out_stream.

Parameters
xml_streamStream where xml data should be output.
name_overrideIf given, this value overrides the name attribute written to the stream. This is useful when writing out looknfeels