Crazy Eddies GUI System  0.7.2
Public Member Functions | Static Public Attributes | List of all members
CEGUI::AnimationInstance Class Reference

Defines an 'animation instance' class. More...

+ Collaboration diagram for CEGUI::AnimationInstance:

Public Member Functions

 AnimationInstance (Animation *definition)
 internal constructor, please use AnimationManager::instantiateAnimation
 ~AnimationInstance (void)
AnimationgetDefinition () const
 Retrieves the animation definition that is used in this instance.
void setTarget (PropertySet *target)
 Sets the target property set - this class will get it's properties affected by the Affectors!
PropertySetgetTarget () const
 Retrieves the target property set.
void setEventReceiver (EventSet *receiver)
 Sets event receiver - this class will receive events when something happens to the playback of this animation - it starts, stops, pauses, unpauses, ends and loops.
EventSetgetEventReceiver () const
 Retrieves the event receiver.
void setEventSender (EventSet *sender)
 Sets event sender - this class will send events and can affect this animation instance if there are any auto subscriptions defined in the animation definition.
EventSetgetEventSender () const
 Retrieves the event sender.
void setTargetWindow (Window *target)
 Helper method, sets given window as target property set, event receiver and event set.
void setPosition (float position)
 Sets playback position. Has to be higher or equal to 0.0 and lower or equal to Animation definition's duration.
float getPosition () const
 Retrieves current playback position.
void setSpeed (float speed)
 Sets playback speed - you can speed up / slow down individual instances of the same animation. 1.0 means normal playback.
float getSpeed () const
 Retrieves current playback speed.
void start ()
 Starts this animation instance - sets position to 0.0 and unpauses. More...
void stop ()
 Stops this animation instance - sets position to 0.0 and pauses.
void pause ()
 Pauses this animation instance - stops it from stepping forward.
void unpause ()
 Unpauses this animation instance - allows it to step forward again.
void togglePause ()
 Pauses the animation if it's running and unpauses it if it isn't.
bool isRunning () const
 Returns true if this animation instance is currently unpaused, if it is stepping forward.
void step (float delta)
 Internal method, steps the animation forward by the given delta.
bool handleStart (const CEGUI::EventArgs &e)
 handler that starts the animation instance
bool handleStop (const CEGUI::EventArgs &e)
 handler that stops the animation instance
bool handlePause (const CEGUI::EventArgs &e)
 handler that pauses the animation instance
bool handleUnpause (const CEGUI::EventArgs &e)
 handler that unpauses the animation instance
bool handleTogglePause (const CEGUI::EventArgs &e)
 handler that toggles pause on this animation instance
void savePropertyValue (const String &propertyName)
 Internal method, saves given property (called before it's affected)
void purgeSavedPropertyValues (void)
const StringgetSavedPropertyValue (const String &propertyName)
void addAutoConnection (Event::Connection conn)
 Internal method, adds reference to created auto connection. More...
void unsubscribeAutoConnections ()
 Internal method, unsubscribes auto connections. More...

Static Public Attributes

static const String EventNamespace
static const String EventAnimationStarted
 fired when animation instance starts
static const String EventAnimationStopped
 fired when animation instance stops
static const String EventAnimationPaused
 fired when animation instance pauses
static const String EventAnimationUnpaused
 fired when animation instance unpauses
static const String EventAnimationEnded
 fired when animation instance ends
static const String EventAnimationLooped
 fired when animation instance loops

Detailed Description

Defines an 'animation instance' class.

Animation classes hold definition of the animation. Whilst this class holds
data needed to use the animation definition - target PropertySet, event
receiver, animation position, ...

You have to define animation first and then instantiate it via
See Also

Constructor & Destructor Documentation

CEGUI::AnimationInstance::~AnimationInstance ( void  )

internal destructor, please use AnimationManager::destroyAnimationInstance

Member Function Documentation

void CEGUI::AnimationInstance::addAutoConnection ( Event::Connection  conn)

Internal method, adds reference to created auto connection.

const String& CEGUI::AnimationInstance::getSavedPropertyValue ( const String propertyName)

retrieves saved value, if it isn't cached already, it retrieves it fresh from the properties

void CEGUI::AnimationInstance::purgeSavedPropertyValues ( void  )

this purges all saved values forcing this class to gather new ones fresh from the properties

void CEGUI::AnimationInstance::start ( )

Starts this animation instance - sets position to 0.0 and unpauses.

This also causes base values to be purged!
void CEGUI::AnimationInstance::unsubscribeAutoConnections ( )

Internal method, unsubscribes auto connections.


Member Data Documentation

const String CEGUI::AnimationInstance::EventNamespace

Namespace for animation instance events these are fired on event receiver, not this animation instance!