コード例 #1
0
ファイル: AnimatedSprite.cs プロジェクト: eickegao/tiny2d
 public void AddAnimation(AnimationInfo newAnimation)
 {
     _animations.Add(newAnimation);
     newAnimation.Parent = this;
     UpdateBoundingRectSize();
 }
コード例 #2
0
ファイル: AnimationInfo.cs プロジェクト: eickegao/tiny2d
 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();
 }
コード例 #3
0
ファイル: AnimatedSprite.cs プロジェクト: eickegao/tiny2d
        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);
            }
        }