Table of Contents

 
SetRepeat
 

Purpose

Sets the flag that determines whether the animation automatically loops once it has reached the end of its sequence

 

Protoype

void CSpriteMngr::SetRepeat (bool b_repeat, string str_anim_id = "")
 

Parameters

repeat whether to enable (TRUE) or disable (FALSE) looping
anim_id the ID of the animation to modify
 

Description

This function controls whether or not an animation will loop when it reaches the end of its sequence. If you want an animation to loop then you would pass in TRUE for b_repeat. If you want the animation to stop (and revert to a default frame if one exists) then you would pass in FALSE for b_repeat. 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.SetRepeat(true);
// access another animation
sprite.SetRepeat(false, "nuther_anim");
 

Prev: SetFrameValue