Exemple #1
0
        public void ChangeAnimation(Animation Animation, ChangeAnimationOptions Options)
        {
            CurrentAnimation = Animation;
            IsLooping        = Animation.Loops;

            if ((Options & ChangeAnimationOptions.Reset) == ChangeAnimationOptions.Reset)
            {
                CurrentFrame = 0;
            }

            if ((Options & ChangeAnimationOptions.Play) == ChangeAnimationOptions.Play)
            {
                IsPlaying = true;
            }

            if ((Options & ChangeAnimationOptions.Stop) == ChangeAnimationOptions.Stop)
            {
                IsPlaying = false;
            }

            if (CurrentAnimation != null)
            {
                if (CurrentFrame >= Animation.GetFrameCount())
                {
                    CurrentFrame = Animation.GetFrameCount() - 1;
                }
            }

            OnAnimationChanged();
        }
 public void Play(Animation Animation)
 {
     CurrentAnimation = Animation;
     if (CurrentFrame >= Animation.GetFrameCount())
     {
         CurrentFrame = Animation.GetFrameCount() - 1;
     }
     IsPlaying = true;
 }
Exemple #3
0
 public void Play(Animation Animation)
 {
     CurrentAnimation = Animation;
     if (CurrentFrame >= Animation.GetFrameCount())
     {
         CurrentFrame = Animation.GetFrameCount() - 1;
     }
     IsPlaying = true;
     IsLooping = Animation.Loops;
     OnAnimationChanged();
 }
Exemple #4
0
        public void NextFrame()
        {
            CurrentFrame++;

            if (CurrentAnimation != null && CurrentFrame >= CurrentAnimation.GetFrameCount())
            {
                if (IsLooping)
                {
                    CurrentFrame = 0;
                }
                else
                {
                    CurrentFrame = CurrentAnimation.GetFrameCount() - 1;
                }
            }
        }