Table of Contents

 
SetDirection
 

Purpose

Sets the new animation direction

 

Protoype

void CSpriteMngr::SetDirection (int i_direction = SWITCH, string str_anim_id = "")
 

Parameters

direction the new direction of the animation
anim_id the ID of the animation to modify
 

Description

This function changes the direction of an animation. If you want an animation to play from beginning to end, then you would pass in FORWARD for i_direction. If you want to play the animation from end to beginning, then you would pass in REVERSE for i_direction. If you don't know the current animation direction and want to reverse it, then you would pass in SWITCH for i_direction. If there is already an animation loaded with LoadAnimation(), then you can set the value for that animation without having to specify it. However if there is no loaded animation or you want to access an animation not loaded, then you must pass in its ID for str_anim_id.

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

 

Use

CSpriteMngr sprite;
// access loaded animation
sprite.SetDirection(FORWARD);
// access another animation
sprite.SetDirection(SWITCH, "nuther_anim");
 

Prev: SetDefaultFrame