Ejemplo n.º 1
0
 /// <summary>
 /// Main constructor
 /// </summary>
 /// <remarks>Using this should be the norm for an animator</remarks>
 /// <param name="anim">The animation to play</param>
 public Animator(Animation anim)
 {
     //Set up the rectangle
     mFrameRect = new Rectangle(0, 0, anim.FrameWidth, anim.FrameHeight);
     Animation = anim;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Plays a certain animation
 /// </summary>
 /// <param name="anim">The animation to play</param>
 /// <param name="effects">The sprite effect to use</param>
 public void Play(Animation anim,SpriteEffects effects)
 {
     if (Animation.Name == anim.Name)
     {
         //Don't do anything
         return;
     }
     //Reset the current animation
     mEffects = effects;
     Animation = anim;
     mFrameRect.X = 0;
     mElaspedTime = 0;
     mCurrentFrame = 0;
 }