Table of Contents

 
LoadAnimation
 

Purpose

Loads a new animation to be played

 

Protoype

void CSpriteMngr::LoadAnimation (string str_anim_id, bool b_play = true)
 

Parameters

anim_id the ID of the animation to load
play whether to play (TRUE) or not play (FALSE) the animation upon load
 

Description

This function takes the animation passed in via str_anim_id and assigns it as the current animation to the locked sprite object. Now whenever PlayAnimation() is called, it will affect this animation. The same goes for any animation access functions with no alternative specified animation. If you want the animation to play immediately, then you can pass in TRUE for b_play, otherwise pass in FALSE.

NOTE: There must be a locked sprite object in order for this function to work

 
Use
CSpriteMngr sprite;
sprite.LoadAnimation("my_anim", true);
 

Prev: IsRepeating