Esempio n. 1
0
        public void AddAnimation(Animation NewAnimation)
        {
            if (animationList.Count == 0)
            {
                currentCol = NewAnimation.StartCol;
                currentRow = NewAnimation.StartRow;
                currentTime = 0;
            }

            if (!animationList.Contains(NewAnimation))
                animationList.Add(NewAnimation);
        }
Esempio n. 2
0
        public Animator(int FrameWidth, int FrameHeight)
        {
            animationList = new List<Animation>();
            activeAnimation = null;
            animating = false;

            frameWidth = FrameWidth;
            frameHeight = FrameHeight;
            currentCol = 0;
            currentRow = 0;

            sourceRect = new Rectangle(0, 0, frameWidth, frameHeight);
            currentTime = 0;
        }
Esempio n. 3
0
 public void StartAnimation(string Animation)
 {
     if (activeAnimation == null)
     {
         foreach (Animation Anim in animationList)
         {
             if (Anim.Name == Animation)
             {
                 activeAnimation = Anim;
                 currentCol = activeAnimation.StartCol;
                 currentRow = activeAnimation.StartRow;
                 animating = true;
                 return;
             }
         }
     }
 }
Esempio n. 4
0
        public void StopAnimation()
        {
            if (activeAnimation != null)
            {
                animating = false;
                currentCol = activeAnimation.StartCol;
                currentRow = activeAnimation.StartRow;
                currentTime = 0;

                UpdateSourceRect();

                activeAnimation = null;
            }
        }
Esempio n. 5
0
 public void StartAnimation(string Animation)
 {
     if (activeAnimation == null)
     {
         foreach (Animation Anim in animationList)
         {
             if (Anim.Name == Animation)
             {
                 Console.WriteLine("STARTED ANIMATION: " + Animation);
                 activeAnimation = Anim;
                 currentCol = activeAnimation.StartCol;
                 currentRow = activeAnimation.StartRow;
                 animating = true;
                 return;
             }
         }
     }
 }
Esempio n. 6
0
 public void ResetPrevAnimation()
 {
     prevAnimation = null;
 }
Esempio n. 7
0
        public void StopAnimation(String AnimationName)
        {
            if (activeAnimation != null)
            {
                if(activeAnimation.Name == AnimationName)
                {
                    animating = false;
                    currentCol = activeAnimation.StartCol;
                    currentRow = activeAnimation.StartRow;
                    currentTime = 0;

                    UpdateSourceRect();

                    prevAnimation = activeAnimation;
                    activeAnimation = null;
                }
            }
        }
Esempio n. 8
0
        public void StopAnimation()
        {
            if (activeAnimation != null)
            {
                animating = false;
                currentCol = activeAnimation.StartCol;
                currentRow = activeAnimation.StartRow;
                currentTime = 0;

                UpdateSourceRect();
                Console.WriteLine("STOPPED ANIMATION: " + activeAnimation.Name);
                prevAnimation = activeAnimation;
                activeAnimation = null;
            }
        }