Arcade Shooter
Public Member Functions | List of all members
KatanaEngine::Animation Class Reference

Represents timing and framing values for texture animations. More...

#include <Animation.h>

Inheritance diagram for KatanaEngine::Animation:
KatanaEngine::Resource

Public Member Functions

virtual void Update (const GameTime *pGameTime)
 Updates the animation. More...
 
virtual bool Load (const std::string &path, ResourceManager *pManager)
 Load the desired animation into memory. More...
 
virtual bool IsCloneable () const
 Used to determine if the animation is cloneable. More...
 
virtual ResourceClone ()
 Used to create a clone of the animation. More...
 
virtual RegionGetCurrentFrame ()
 Gets a pointer to the current frame. More...
 
virtual RegionGetFrame (const int index)
 Gets a pointer to the indexed frame. More...
 
virtual TextureGetTexture () const
 Gets a pointer to the texture of the animation. More...
 
virtual void SetTexture (Texture *pTexture)
 Sets the texture of the animation. More...
 
virtual void SetCurrentFrame (const unsigned int index)
 Sets the current frame of the animation. More...
 
virtual bool IsPlaying () const
 Determines if the animation is playing. More...
 
virtual void Play ()
 Starts or resumes the animation.
 
virtual void Pause ()
 Pauses the animation.
 
virtual void Stop ()
 Stops the animation.
 
virtual void SetLoopCount (uint16_t loops=-1)
 Sets how many times the animation will run before it stops. More...
 
- Public Member Functions inherited from KatanaEngine::Resource
unsigned short GetResourceID () const
 Gets the ID of the resource. More...
 

Additional Inherited Members

- Protected Member Functions inherited from KatanaEngine::Resource
void Split (const std::string &line, const char delimeter, std::vector< std::string > &elements)
 Splits a string into a vector of strings. More...
 
void ParseComments (std::string &line)
 Removes c-style, single-line comments from a line of text. More...
 
void TrimLine (std::string &line)
 Removes white-space at the front and end of a line of text. More...
 
ResourceManagerGetResourceManager ()
 Gets a pointer to the ResourceManager that was used to load the resource. More...
 

Detailed Description

Represents timing and framing values for texture animations.

Member Function Documentation

◆ Clone()

Resource * KatanaEngine::Animation::Clone ( )
virtual

Used to create a clone of the animation.

Returns
Returns a clone of the animation.

Reimplemented from KatanaEngine::Resource.

◆ GetCurrentFrame()

virtual Region* KatanaEngine::Animation::GetCurrentFrame ( )
inlinevirtual

Gets a pointer to the current frame.

Returns
Returns a Region that defines the size and position of the current frame.

◆ GetFrame()

virtual Region* KatanaEngine::Animation::GetFrame ( const int  index)
inlinevirtual

Gets a pointer to the indexed frame.

Returns
Returns a Region that defines the size and position of the indexed frame.

◆ GetTexture()

virtual Texture* KatanaEngine::Animation::GetTexture ( ) const
inlinevirtual

Gets a pointer to the texture of the animation.

Returns
Returns a pointer to the texture.

◆ IsCloneable()

virtual bool KatanaEngine::Animation::IsCloneable ( ) const
inlinevirtual

Used to determine if the animation is cloneable.

Returns
Returns true if the animation is clonable, false otherwise.
Remarks
Animations should usually be kept as cloneable. Sharing an animation will result in the animations playing syncronized.

Implements KatanaEngine::Resource.

◆ IsPlaying()

virtual bool KatanaEngine::Animation::IsPlaying ( ) const
inlinevirtual

Determines if the animation is playing.

Returns
Returns true if the animation is playing, false otherwise.

◆ Load()

bool KatanaEngine::Animation::Load ( const std::string &  path,
ResourceManager pManager 
)
virtual

Load the desired animation into memory.

Parameters
pathThe path to the desired animation.
pManagerA pointer to the resource manager that will manage the animation.
Returns
Returns true if the animation was loaded, false otherwise.

Implements KatanaEngine::Resource.

◆ SetCurrentFrame()

void KatanaEngine::Animation::SetCurrentFrame ( const unsigned int  index)
virtual

Sets the current frame of the animation.

Parameters
indexThe index of the frame to set as the current frame.
Remarks
If the indexed frame is invalid it will be ignored.

◆ SetLoopCount()

virtual void KatanaEngine::Animation::SetLoopCount ( uint16_t  loops = -1)
inlinevirtual

Sets how many times the animation will run before it stops.

Parameters
loopsThe number of loops to play. Setting loops to -1 will make the animation loop infinitely.

◆ SetTexture()

virtual void KatanaEngine::Animation::SetTexture ( Texture pTexture)
inlinevirtual

Sets the texture of the animation.

Parameters
pTextureA pointer to the texture resource.

◆ Update()

void KatanaEngine::Animation::Update ( const GameTime pGameTime)
virtual

Updates the animation.

Parameters
pGameTimeTiming values including time since last update.

The documentation for this class was generated from the following files: