Table of Contents

 
SetDefaultFrame
 

Purpose

Sets a new default animation frame

 

Protoype

void CSpriteMngr::SetDefaultFrame (int i_def_frame, string str_anim_id = "")
 

Parameters

def_frame the new default frame in the sequence
anim_id the ID of the animation to modify
 

Description

This function sets a new default frame for an animation sequence. A default frame is the frame that the animation sequence reverts to when it is stopped. You can pass in a valid frame value for i_def_frame or use the constant NO_DEF_FRAME to disable the default frame for this animation. The function bound-checks the frame value passed in to ensure it is valid. 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.SetDefaultFrame(0);
// access another animation
sprite.SetDefaultFrame(NO_DEF_FRAME, "nuther_anim");
 

Prev: SetCurrentFrame