Ejemplo n.º 1
0
 public void AddAnimation(AnimationInfo newAnimation)
 {
     _animations.Add(newAnimation);
     newAnimation.Parent = this;
     UpdateBoundingRectSize();
 }
Ejemplo n.º 2
0
 public void CopyValuesTo(AnimationInfo target, AnimatedSprite newParent)
 {
     target.Parent = newParent;
     target.Name = Name;
     target.IsPaused = this.IsPaused;
     target.IsStopped = this.IsStopped;
     target.LoopMax = this.LoopMax;
     target.AutoPlay = this.AutoPlay;
     target.HideWhenStopped = this.HideWhenStopped;
     // copy frames (it's a struct, so it's copied by value)
     target.AnimationFrames.Clear();
     for (int i = 0; i < this.AnimationFrames.Count; i++)
     {
         target.AnimationFrames.Add(this.AnimationFrames[i]);
     }
     target.Reset();
 }
Ejemplo n.º 3
0
        internal void OnEndOfAnimLoopReached(AnimationInfo animation)
        {
            if (_queuedAnimationID.HasValue)
            {
                animation.IsStopped = true;
                animation.Reset();
                _currentAnimationID = _queuedAnimationID.Value;
                _animations[_queuedAnimationID.Value].Play();
                UpdateBoundingRectSize();
                _queuedAnimationID = null;

            }
            if (EndOfAnimLoopReached != null)
            {
                EndOfAnimLoopReached(animation, EventArgs.Empty);
            }
        }