示例#1
0
 public Costume StartAnimation(Animation animation)
 {
     CurrentFrameIndex = 1;
     this.animation = animation;
     elapsedFrameSeconds = 0;
     return this;
 }
示例#2
0
 public void StopAnimation()
 {
     this.animation = null;
 }
示例#3
0
 /// <summary>
 /// Create an animation using all frames with the same time per frame
 /// </summary>
 /// <param name="frameSeconds">Seconds per frame</param>
 /// <returns>The generated animation object</returns>
 public Animation CreateAnimation(float frameSeconds)
 {
     this.frameSeconds = frameSeconds;
     Animation animation = new Animation();
     for (int i = 0; i < this.FrameCount; i++)
     {
         animation.AddFrame(i+1, frameSeconds);
     }
     return animation;
 }