public void AddAnimation(Animation NewAnimation) { if (animationList.Count == 0) { currentCol = NewAnimation.StartCol; currentRow = NewAnimation.StartRow; currentTime = 0; } if (!animationList.Contains(NewAnimation)) animationList.Add(NewAnimation); }
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; }
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; } } } }
public void StopAnimation() { if (activeAnimation != null) { animating = false; currentCol = activeAnimation.StartCol; currentRow = activeAnimation.StartRow; currentTime = 0; UpdateSourceRect(); activeAnimation = null; } }
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; } } } }
public void ResetPrevAnimation() { prevAnimation = null; }
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; } } }
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; } }