Crazy Eddie's GUI System
0.8.4
|
Defines an 'animation instance' class. More...
Public Member Functions | |
AnimationInstance (Animation *definition) | |
internal constructor, please use AnimationManager::instantiateAnimation | |
~AnimationInstance (void) | |
Animation * | getDefinition () 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! | |
PropertySet * | getTarget () 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. | |
EventSet * | getEventReceiver () 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. | |
EventSet * | getEventSender () 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 | setSkipNextStep (bool skip) |
Controls whether the next time step is skipped. | |
bool | getSkipNextStep () const |
Returns true if the next step is *going* to be skipped. | |
void | setMaxStepDeltaSkip (float maxDelta) |
Sets the max delta before step skipping occurs. | |
float | getMaxStepDeltaSkip () const |
Gets the max delta before step skipping occurs. | |
void | setMaxStepDeltaClamp (float maxDelta) |
Sets the max delta before step clamping occurs. | |
float | getMaxStepDeltaClamp () const |
Gets the max delta before step clamping occurs. | |
void | start (bool skipNextStep=true) |
Starts this animation instance - sets position to 0.0 and unpauses. | |
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 (bool skipNextStep=true) |
Unpauses this animation instance - allows it to step forward again. | |
void | togglePause (bool skipNextStep=true) |
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 | setAutoSteppingEnabled (bool enabled) |
Controls whether auto stepping is enabled. | |
bool | isAutoSteppingEnabled () const |
Checks whether auto stepping is enabled. | |
void | step (float delta) |
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 String & | getSavedPropertyValue (const String &propertyName) |
void | addAutoConnection (Event::Connection conn) |
Internal method, adds reference to created auto connection. | |
void | unsubscribeAutoConnections () |
Internal method, unsubscribes auto connections. | |
void | apply () |
Applies this animation instance. | |
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 |
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 AnimationManager::instantiateAnimation
internal destructor, please use AnimationManager::destroyAnimationInstance
Internal method, adds reference to created auto connection.
void CEGUI::AnimationInstance::apply | ( | ) |
Applies this animation instance.
const String& CEGUI::AnimationInstance::getSavedPropertyValue | ( | const String & | propertyName | ) |
retrieves saved value, if it isn't cached already, it retrieves it fresh from the properties
bool CEGUI::AnimationInstance::getSkipNextStep | ( | ) | const |
Returns true if the next step is *going* to be skipped.
void CEGUI::AnimationInstance::purgeSavedPropertyValues | ( | void | ) |
this purges all saved values forcing this class to gather new ones fresh from the properties
void CEGUI::AnimationInstance::setAutoSteppingEnabled | ( | bool | enabled | ) |
Controls whether auto stepping is enabled.
void CEGUI::AnimationInstance::setMaxStepDeltaClamp | ( | float | maxDelta | ) |
Sets the max delta before step clamping occurs.
maxDelta | delta in seconds, if this value is reached, the step is clamped. (use -1.0f if you never want to clamp - this is the default) |
void CEGUI::AnimationInstance::setMaxStepDeltaSkip | ( | float | maxDelta | ) |
Sets the max delta before step skipping occurs.
maxDelta | delta in seconds, if this value is reached, the step is skipped (use -1.0f if you never want to skip - this is the default) |
For example setMaxStepDeltaSkip(1.0f / 25.0f) ensures that if FPS drops below 25, the animation just stops progressing and waits till FPS raises.
void CEGUI::AnimationInstance::start | ( | bool | skipNextStep = true | ) |
Starts this animation instance - sets position to 0.0 and unpauses.
skipNextStep | if true the next injected time pulse is skipped |
void CEGUI::AnimationInstance::step | ( | float | delta | ) |
Steps the animation forward by the given delta.
void CEGUI::AnimationInstance::togglePause | ( | bool | skipNextStep = true | ) |
Pauses the animation if it's running and unpauses it if it isn't.
skipNextStep | if true the next injected time pulse is skipped (only applies when unpausing!) |
void CEGUI::AnimationInstance::unpause | ( | bool | skipNextStep = true | ) |
Unpauses this animation instance - allows it to step forward again.
skipNextStep | if true the next injected time pulse is skipped |
Internal method, unsubscribes auto connections.
const String CEGUI::AnimationInstance::EventNamespace [static] |
Namespace for animation instance events these are fired on event receiver, not this animation instance!