UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ugdk::action::AnimationPlayer< Frame > Singleton Reference

#include <ugdk/action/animationplayer.h>

Inheritance diagram for ugdk::action::AnimationPlayer< Frame >:
Collaboration diagram for ugdk::action::AnimationPlayer< Frame >:

Public Types

using Animation = ::ugdk::action::Animation< Frame >
 
using AnimationTable = structure::IndexableTable< Animation >
 
using FrameChangedCallback = std::function< void(const Frame &)>
 

Public Member Functions

 AnimationPlayer (const AnimationTable *table)
 
void set_frame_change_callback (const FrameChangedCallback &callback)
 
const Animationcurrent_animation () const
 
const Frame & current_animation_frame () const
 
void Update (double dt)
 
void RestartAnimation ()
 Restarts the current animation from the first frame. More...
 
void Select (const std::string &name)
 Change the current animation to a new animation from the previously selected AnimationSet. More...
 
void Select (int index)
 Change the current animation to a new animation from the previo2usly selected AnimationSet. More...
 
void Refresh ()
 Calls the frame changed callback with the current frame. More...
 
- Public Member Functions inherited from ugdk::action::MediaPlayer
 MediaPlayer ()
 
virtual ~MediaPlayer ()
 
void AddObserver (Observer *observer)
 Add a observer object to the animation. More...
 
void AddTickFunction (std::function< void(void)> tick)
 
void ChangeMediaManager (MediaManager *)
 

Additional Inherited Members

- Protected Member Functions inherited from ugdk::action::MediaPlayer
void notifyAllObservers ()
 

Member Typedef Documentation

template<class Frame >
using ugdk::action::AnimationPlayer< Frame >::Animation = ::ugdk::action::Animation<Frame>
template<class Frame >
using ugdk::action::AnimationPlayer< Frame >::FrameChangedCallback = std::function<void(const Frame&)>

Constructor & Destructor Documentation

template<class Frame >
ugdk::action::AnimationPlayer< Frame >::AnimationPlayer ( const AnimationTable table)
inline

Member Function Documentation

template<class Frame >
const Animation* ugdk::action::AnimationPlayer< Frame >::current_animation ( ) const
inline
template<class Frame >
const Frame& ugdk::action::AnimationPlayer< Frame >::current_animation_frame ( ) const
inline
template<class Frame >
void ugdk::action::AnimationPlayer< Frame >::Refresh ( )
inline

Calls the frame changed callback with the current frame.

template<class Frame >
void ugdk::action::AnimationPlayer< Frame >::RestartAnimation ( )
inline

Restarts the current animation from the first frame.

template<class Frame >
void ugdk::action::AnimationPlayer< Frame >::Select ( const std::string &  name)
inline

Change the current animation to a new animation from the previously selected AnimationSet.

Given a animation name (a string), the function changes the current animation to a new animation of AnimationSet

template<class Frame >
void ugdk::action::AnimationPlayer< Frame >::Select ( int  index)
inline

Change the current animation to a new animation from the previo2usly selected AnimationSet.

Given a animation index (a integer), the function changes the current animation to a new animation of AnimationSet

template<class Frame >
void ugdk::action::AnimationPlayer< Frame >::set_frame_change_callback ( const FrameChangedCallback callback)
inline
template<class Frame >
void ugdk::action::AnimationPlayer< Frame >::Update ( double  dt)
inlinevirtual

The documentation for this singleton was generated from the following file: