AnimationController Class Reference
#include <AnimationController.h>
# Public Member Functions | |
| void | constructor () |
| Class' constructor. | |
| bool | play (const AnimationFunction *animationFunctions[], const char *animationName, ListenerObject scope) |
| void | playAnimationFunction (const AnimationFunction *animationFunction, ListenerObject scope) |
| bool | replay (const AnimationFunction *animationFunctions[]) |
| void | pause (bool pause) |
| void | stop () |
| Stop any playing animation if any. | |
| bool | updateAnimation () |
| Update the current playing animation if any. | |
| bool | isPlaying () |
| bool | isPlayingFunction (const char *animationName) |
| void | nextFrame () |
| Skip the currently playing animation to the next frame. | |
| void | previousFrame () |
| Rewind the currently playing animation to the previous frame. | |
| bool | setActualFrame (int16 actualFrame) |
| int16 | getActualFrame () |
| int16 | getActualFrameIndex () |
| void | setFrameDuration (uint8 frameDuration) |
| uint8 | getFrameDuration () |
| Retrieve the duration in game cycles for each frame of animation. | |
| void | setFrameDurationDecrement (uint8 frameCycleDecrement) |
| uint8 | getFrameDurationDecrement () |
| void | setAnimationCoordinator (AnimationCoordinator animationCoordinator) |
| AnimationCoordinator | getAnimationCoordinator () |
| const AnimationFunction * | getPlayingAnimationFunction () |
| const char * | getPlayingAnimationName () |
| int32 | getNumberOfFrames () |
| bool | isAnimationLooped () |
# Protected Attributes | |
| AnimationCoordinator | animationCoordinator |
| Animation coordinator that syncs the animations with other animation controllers. | |
| const AnimationFunction * | animationFunction |
| Pointer to the current animation function being played. | |
| int16 | actualFrame |
| The current frame of the playing animation function. | |
| int16 | actualFrameIndex |
| The current frame index of the playing animation function. | |
| uint8 | frameDuration |
| Number of game cycles that an animation frame persists. | |
| uint8 | frameDurationDecrement |
| Decrement to frameDuration in each game cycle. | |
| uint8 | playing |
| Flag that signals if playing an animation. | |
# Additional Inherited Members | |
Private Member Functions inherited from ListenerObject | |
| void | constructor () |
| Class' constructor. | |
| void | destructor () |
| Class' destructor. | |
| void | addEventListener (ListenerObject listener, uint16 eventCode) |
| void | removeEventListener (ListenerObject listener, uint16 eventCode) |
| void | removeEventListeners (uint16 eventCode) |
| void | removeAllEventListeners () |
| Remove all listener objects. | |
| bool | hasActiveEventListeners () |
| void | fireEvent (uint16 eventCode) |
| void | sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay) |
| void | sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay) |
| void | discardAllMessages () |
| Discard all messages, both to be sent and to be received. | |
| void | discardMessages (uint32 message) |
| virtual bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
| virtual bool | handleMessage (Telegram telegram) |
Private Attributes inherited from ListenerObject | |
| VirtualList | events |
| List of registered events. | |
| int8 | eventFirings |
| Counter that keeps track of the number of fired events to prevent race conditions in nested firings. | |
# Detailed Description
Class AnimationController
Inherits from ListenerObject
Controls animations.
Definition at line 35 of file AnimationController.h.
# Member Function Documentation
# constructor()
| void AnimationController::constructor | ( | ) |
Class' constructor.
Definition at line 28 of file AnimationController.c.
# getActualFrame()
| int16 AnimationController::getActualFrame | ( | ) |
Retrieve the actual frame of the playing animation if any.
- Returns
- Actual frame of the playing animation if any
Definition at line 376 of file AnimationController.c.
# getActualFrameIndex()
| int16 AnimationController::getActualFrameIndex | ( | ) |
Retrieve the actual frame index of the playing animation if any.
- Returns
- Actual frame index of the playing animation if any
Definition at line 383 of file AnimationController.c.
# getAnimationCoordinator()
| AnimationCoordinator AnimationController::getAnimationCoordinator | ( | ) |
Retrieve the animation coordinator for this animation controller.
- Returns
- Animation coordinator for this animation controller
Definition at line 426 of file AnimationController.c.
# getFrameDuration()
| uint8 AnimationController::getFrameDuration | ( | ) |
Retrieve the duration in game cycles for each frame of animation.
Definition at line 397 of file AnimationController.c.
# getFrameDurationDecrement()
| uint8 AnimationController::getFrameDurationDecrement | ( | ) |
Retrieve the decrement to frameDuration in each game cycle for each frame of animation.
- Returns
- Decrement to frameDuration in each game cycle for each frame of animation
Definition at line 411 of file AnimationController.c.
# getNumberOfFrames()
| int32 AnimationController::getNumberOfFrames | ( | ) |
Retrieve the number of frames in the currently playing if any
- Returns
- Number of frames in the currently playing if any
Definition at line 452 of file AnimationController.c.
# getPlayingAnimationFunction()
| const AnimationFunction * AnimationController::getPlayingAnimationFunction | ( | ) |
Retrieve the animation function currently playing if any
- Returns
- Animation function currently playing if any
Definition at line 433 of file AnimationController.c.
# getPlayingAnimationName()
| const char * AnimationController::getPlayingAnimationName | ( | ) |
Retrieve the animation function's name currently playing if any
- Returns
- Animation function's name currently playing if any
Definition at line 440 of file AnimationController.c.
# isAnimationLooped()
| bool AnimationController::isAnimationLooped | ( | ) |
Check if the currently playing animation is looped or not.
- Returns
- True or false
Definition at line 464 of file AnimationController.c.
# isPlaying()
| bool AnimationController::isPlaying | ( | ) |
Check if an animation is playing.
- Returns
- True if an animation is playing; false otherwise
Definition at line 287 of file AnimationController.c.
# isPlayingFunction()
| bool AnimationController::isPlayingFunction | ( | const char * | animationName | ) |
Check if the animation whose name is provided is playing.
- Parameters
-
animationName Name of the animation to check
- Returns
- True if an animation is playing; false otherwise
Definition at line 294 of file AnimationController.c.
# nextFrame()
| void AnimationController::nextFrame | ( | ) |
Skip the currently playing animation to the next frame.
Definition at line 307 of file AnimationController.c.
# pause()
| void AnimationController::pause | ( | bool | pause | ) |
Pause or unpause the currently playing animation if any.
- Parameters
-
pause Flag that signals if the animation must be paused or unpaused
Definition at line 192 of file AnimationController.c.
# play()
| bool AnimationController::play | ( | const AnimationFunction * | animationFunctions[], |
| const char * | animationName, | ||
| ListenerObject | scope ) |
Play the animation with the provided name from the provided array of animation functions.
- Parameters
-
animationFunctions Array of functions where to look for the animation to play animationName Name of the animation to play scope Object that will be notified of playback events
- Returns
- True if the animation started playing; false otherwise
Definition at line 65 of file AnimationController.c.
# playAnimationFunction()
| void AnimationController::playAnimationFunction | ( | const AnimationFunction * | animationFunction, |
| ListenerObject | scope ) |
Play the animation defined by the the provided animation function.
- Parameters
-
animationFunction Animation function to play scope Object that will be notified of playback events
Definition at line 132 of file AnimationController.c.
# previousFrame()
| void AnimationController::previousFrame | ( | ) |
Rewind the currently playing animation to the previous frame.
Definition at line 331 of file AnimationController.c.
# replay()
| bool AnimationController::replay | ( | const AnimationFunction * | animationFunctions[] | ) |
Replay the last playing animation, if any, from the provided array of animation functions.
- Parameters
-
animationFunctions Array of animation functions to look for the animation function to replay
- Returns
- True if the animation started playing again; false otherwise
Definition at line 163 of file AnimationController.c.
# setActualFrame()
Skip the currently playing animation to the provided frame.
- Parameters
-
actualFrame The frame of the playing animation to skip to
- Returns
- True if the actual frame was changed; false otherwise
Definition at line 355 of file AnimationController.c.
# setAnimationCoordinator()
| void AnimationController::setAnimationCoordinator | ( | AnimationCoordinator | animationCoordinator | ) |
Set the animation coordinator for this animation controller.
- Parameters
-
animationCoordinator Animation coordinator for this animation controller
Definition at line 418 of file AnimationController.c.
# setFrameDuration()
| void AnimationController::setFrameDuration | ( | uint8 | frameDuration | ) |
Set the duration in game cycles for each frame of animation.
- Parameters
-
frameDuration Duration in game cycles for each frame of animation
Definition at line 390 of file AnimationController.c.
# setFrameDurationDecrement()
| void AnimationController::setFrameDurationDecrement | ( | uint8 | frameCycleDecrement | ) |
Set the decrement to frameDuration in each game cycle for each frame of animation.
- Parameters
-
frameCycleDecrement Decrement to frameDuration in each game cycle for each frame of animation
Definition at line 404 of file AnimationController.c.
# stop()
| void AnimationController::stop | ( | ) |
Stop any playing animation if any.
Definition at line 204 of file AnimationController.c.
# updateAnimation()
| bool AnimationController::updateAnimation | ( | ) |
Update the current playing animation if any.
Definition at line 213 of file AnimationController.c.
# Member Data Documentation
# actualFrame
|
protected |
The current frame of the playing animation function.
Definition at line 46 of file AnimationController.h.
# actualFrameIndex
|
protected |
The current frame index of the playing animation function.
Definition at line 49 of file AnimationController.h.
# animationCoordinator
|
protected |
Animation coordinator that syncs the animations with other animation controllers.
Definition at line 40 of file AnimationController.h.
# animationFunction
|
protected |
Pointer to the current animation function being played.
Definition at line 43 of file AnimationController.h.
# frameDuration
|
protected |
Number of game cycles that an animation frame persists.
Definition at line 52 of file AnimationController.h.
# frameDurationDecrement
|
protected |
Decrement to frameDuration in each game cycle.
Definition at line 55 of file AnimationController.h.
# playing
|
protected |
Flag that signals if playing an animation.
Definition at line 58 of file AnimationController.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Component/VisualComponent/Sprite/AnimationController/AnimationController.h
- VUEngine-Core/source/Component/VisualComponent/Sprite/AnimationController/AnimationController.c
Private Member Functions inherited from