public PlayAnimation ( string name, int startFrame, int endFrame, bool loop = true, bool backwards = false ) : void | ||
name | string | /////// The name of the animation. /////// |
startFrame | int | /// The frame where the animation starts playing. /// |
endFrame | int | /// The last frame of the animation to play. /// |
loop | bool |
/////// if set to |
backwards | bool |
/////// if set to |
return | void |
public override void PlayAnimation(string name, int? startFrame, int? endFrame, bool loop = true, bool backwards = false)
{
this.CurrentAnimation = name;
this.BoundingBoxRefreshed = true;
this.Loop = loop;
this.State = AnimationState.Playing;
this.Backwards = backwards;
this.totalAnimTime = TimeSpan.Zero;
int start = this.lastFrame = startFrame.HasValue ? startFrame.Value : 0;
int end = this.targetFrame = endFrame.HasValue ? endFrame.Value : this.numFrames - 1;
if (backwards)
{
this.prevFrame = end;
this.frame = start;
}
else
{
this.prevFrame = start;
this.frame = end;
}
}