![]() |
AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
An instance of an animation object. More...
#include <CzAnim.h>
Public Member Functions | |
void | setParent (CzAnimTimeline *parent) |
CzAnimTimeline * | getParent () |
CzAnim * | getAnimation () |
void | setAnimation (CzAnim *anim) |
Assigns a CzAnim animation to this animation instance. | |
void | setManaged (bool managed) |
bool | isManaged () const |
int | getRepeatCount () const |
void | setRepeatCount (int repeat_count) |
void | setCurrentTime (float current_time) |
float | getCurrentTime () const |
bool | isFinished () const |
CzAnimFrame * | getCurrentData () |
unsigned int | getTargetPropertyHash () |
IzAnimTarget * | getTargetElement () |
void | setTarget (IzAnimTarget *element, const char *property_name) |
void | setTargetElement (IzAnimTarget *element) |
float | getDelay () const |
void | setDelay (float delay) |
bool | isStarted () const |
bool | isStopped () const |
bool | isPlaying () const |
bool | isPaused () const |
bool | isDelayed () const |
void | restart () |
void | play () |
void | stop () |
void | pause () |
void | setStartedCallback (CzCallback callback) |
void | setStoppedCallback (CzCallback callback) |
void | setLoopedCallback (CzCallback callback) |
bool | isCurrentDataValid () const |
void | setDelta (bool is_delta) |
bool | isDelta () const |
void | setInterpolate (bool interpolate) |
bool | isInterpolated () const |
void | addEventsManager () |
CzEventManager * | getEventsManager () |
CzAnimInstance () | |
virtual | ~CzAnimInstance () |
virtual bool | Update (float dt, IzAnimTarget *target=NULL) |
Updates the animation instance. | |
virtual void | UpdateTargetOnly (IzAnimTarget *target) |
Updates the instances target only. | |
virtual void | ForceUpdateTargetOnly (IzAnimTarget *target) |
Updates the instances target only. | |
virtual void | ProcessEventActions (unsigned int event_name) |
Process the event actions described by event_name. | |
virtual void | NotifyStart () |
This event is called when this aimation instance is started. | |
virtual void | NotifyEnd () |
This event is called when this aimation instance stopped playing. | |
virtual void | NotifyRepeat () |
This event is called when this aimation instance repeats. | |
Protected Attributes | |
CzAnimTimeline * | Parent |
Parent timeline. | |
CzAnim * | Animation |
Animation to use. | |
bool | Managed |
True if managed by a CzAnimInstanceManager. | |
int | RepeatCount |
Number of times to replay the animation. | |
float | CurrentTime |
Current animation time (0 is start of animation) | |
CzAnimFrame * | CurrentData |
The current interpolated data for the current time. | |
CzAnim::eAnimStatus | Status |
Status of the animation. | |
bool | Started |
If set to true then the animation has started playing. | |
IzAnimTarget * | Target |
Target object to update. | |
unsigned int | TargetPropertyHash |
Target object property name as a string hash to update. | |
float | Delay |
Amount of time to delay starting the animation. | |
bool | DelayExpired |
true if initial delay has expired | |
CzCallback | StartedCallback |
Callback which is called when the animation starts playing. | |
CzCallback | StoppedCallback |
Callback which is called when the animation stops playing. | |
CzCallback | LoopedCallback |
Callback which is called when the animation loops. | |
bool | CurrentDataValid |
True if current frame data is valid. | |
bool | IsDelta |
Delta animation should update the target variables value instead of replacing it. | |
bool | Interpolate |
If true then the interpolated valiue between key frames will be calculated and applied. | |
CzEventManager * | EventsManager |
List of events that the animation handles. | |
int | RepeatedCount |
An instance of an animation object.
CzAnim is not played directly, instead you create an instance of it using CzAnimInstance:
// Create and set up an animation CzAnimInstance* face_anim = new CzAnimInstance(); face_anim->setAnimation(anim); face_anim->setTarget(actor, "SrcRect");
Note the following line of code:
face_anim->setTarget(actor, "SrcRect");
This line of code tells the animation to modify the "SrcRect" (the actors image atlas position) property of the actor object, causing the image to change.
Animation instances can be played, paused, resumed, stopped and restarted. You can also tell an animation to delay playing for a finite period of time.
CzAnimInstance::CzAnimInstance | ( | ) | [inline] |
CzAnimInstance::~CzAnimInstance | ( | ) | [virtual] |
void CzAnimInstance::addEventsManager | ( | ) |
void CzAnimInstance::ForceUpdateTargetOnly | ( | IzAnimTarget * | target | ) | [virtual] |
Updates the instances target only.
This method force updates this animation instances target only, even if th animation is not playing.
[in,out] | target | If non-null, the target. |
CzAnim* CzAnimInstance::getAnimation | ( | ) | [inline] |
CzAnimFrame* CzAnimInstance::getCurrentData | ( | ) | [inline] |
float CzAnimInstance::getCurrentTime | ( | ) | const [inline] |
float CzAnimInstance::getDelay | ( | ) | const [inline] |
CzEventManager* CzAnimInstance::getEventsManager | ( | ) | [inline] |
CzAnimTimeline* CzAnimInstance::getParent | ( | ) | [inline] |
int CzAnimInstance::getRepeatCount | ( | ) | const [inline] |
IzAnimTarget* CzAnimInstance::getTargetElement | ( | ) | [inline] |
unsigned int CzAnimInstance::getTargetPropertyHash | ( | ) | [inline] |
bool CzAnimInstance::isCurrentDataValid | ( | ) | const [inline] |
bool CzAnimInstance::isDelayed | ( | ) | const [inline] |
bool CzAnimInstance::isDelta | ( | ) | const [inline] |
bool CzAnimInstance::isFinished | ( | ) | const [inline] |
bool CzAnimInstance::isInterpolated | ( | ) | const [inline] |
bool CzAnimInstance::isManaged | ( | ) | const [inline] |
bool CzAnimInstance::isPaused | ( | ) | const [inline] |
bool CzAnimInstance::isPlaying | ( | ) | const [inline] |
bool CzAnimInstance::isStarted | ( | ) | const [inline] |
bool CzAnimInstance::isStopped | ( | ) | const [inline] |
void CzAnimInstance::NotifyEnd | ( | ) | [virtual] |
This event is called when this aimation instance stopped playing.
void CzAnimInstance::NotifyRepeat | ( | ) | [virtual] |
This event is called when this aimation instance repeats.
void CzAnimInstance::NotifyStart | ( | ) | [virtual] |
This event is called when this aimation instance is started.
void CzAnimInstance::pause | ( | ) | [inline] |
void CzAnimInstance::play | ( | ) | [inline] |
void CzAnimInstance::ProcessEventActions | ( | unsigned int | event_name | ) | [virtual] |
Process the event actions described by event_name.
Processes the actions list that is associated with the event named event_name (event_name is a hash of the actual event name to speed up searches)
event_name | Name of the event as a string hash |
void CzAnimInstance::restart | ( | ) | [inline] |
void CzAnimInstance::setAnimation | ( | CzAnim * | anim | ) |
Assigns a CzAnim animation to this animation instance.
[in] | anim | If non-null, the animation. |
void CzAnimInstance::setCurrentTime | ( | float | current_time | ) | [inline] |
void CzAnimInstance::setDelay | ( | float | delay | ) | [inline] |
void CzAnimInstance::setDelta | ( | bool | is_delta | ) | [inline] |
void CzAnimInstance::setInterpolate | ( | bool | interpolate | ) | [inline] |
void CzAnimInstance::setLoopedCallback | ( | CzCallback | callback | ) | [inline] |
void CzAnimInstance::setManaged | ( | bool | managed | ) | [inline] |
void CzAnimInstance::setParent | ( | CzAnimTimeline * | parent | ) | [inline] |
void CzAnimInstance::setRepeatCount | ( | int | repeat_count | ) | [inline] |
void CzAnimInstance::setStartedCallback | ( | CzCallback | callback | ) | [inline] |
void CzAnimInstance::setStoppedCallback | ( | CzCallback | callback | ) | [inline] |
void CzAnimInstance::setTarget | ( | IzAnimTarget * | element, |
const char * | property_name | ||
) | [inline] |
void CzAnimInstance::setTargetElement | ( | IzAnimTarget * | element | ) | [inline] |
void CzAnimInstance::stop | ( | ) | [inline] |
bool CzAnimInstance::Update | ( | float | dt, |
IzAnimTarget * | target = NULL |
||
) | [virtual] |
Updates the animation instance.
This method updates this animation instance, including:
dt | The number of seconds since the app was last updated | |
[in,out] | target | If non-null, the target. |
void CzAnimInstance::UpdateTargetOnly | ( | IzAnimTarget * | target | ) | [virtual] |
Updates the instances target only.
This method updates this animation instances target only.
[in,out] | target | If non-null, the target. |
CzAnim* CzAnimInstance::Animation [protected] |
Animation to use.
CzAnimFrame* CzAnimInstance::CurrentData [protected] |
The current interpolated data for the current time.
bool CzAnimInstance::CurrentDataValid [protected] |
True if current frame data is valid.
float CzAnimInstance::CurrentTime [protected] |
Current animation time (0 is start of animation)
float CzAnimInstance::Delay [protected] |
Amount of time to delay starting the animation.
bool CzAnimInstance::DelayExpired [protected] |
true if initial delay has expired
CzEventManager* CzAnimInstance::EventsManager [protected] |
List of events that the animation handles.
bool CzAnimInstance::Interpolate [protected] |
If true then the interpolated valiue between key frames will be calculated and applied.
bool CzAnimInstance::IsDelta [protected] |
Delta animation should update the target variables value instead of replacing it.
CzCallback CzAnimInstance::LoopedCallback [protected] |
Callback which is called when the animation loops.
bool CzAnimInstance::Managed [protected] |
True if managed by a CzAnimInstanceManager.
CzAnimTimeline* CzAnimInstance::Parent [protected] |
Parent timeline.
int CzAnimInstance::RepeatCount [protected] |
Number of times to replay the animation.
int CzAnimInstance::RepeatedCount [protected] |
bool CzAnimInstance::Started [protected] |
If set to true then the animation has started playing.
CzCallback CzAnimInstance::StartedCallback [protected] |
Callback which is called when the animation starts playing.
CzAnim::eAnimStatus CzAnimInstance::Status [protected] |
Status of the animation.
CzCallback CzAnimInstance::StoppedCallback [protected] |
Callback which is called when the animation stops playing.
IzAnimTarget* CzAnimInstance::Target [protected] |
Target object to update.
unsigned int CzAnimInstance::TargetPropertyHash [protected] |
Target object property name as a string hash to update.