protected void fireAnimationComplete(LayoutContainer oldChild)
 {
     if (AnimationComplete != null)
     {
         AnimationComplete.Invoke(oldChild);
     }
 }
Exemple #2
0
        public void Update(GameTime gameTime)
        {
            if (isHidden == true)
            {
                return;
            }

            if (totalFrames > 1)
            {
                lastElapsedTime += gameTime.ElapsedGameTime;

                if (lastElapsedTime > frameInterval)
                {
                    currentFrame    = (currentFrame + 1) % totalFrames;
                    lastElapsedTime = TimeSpan.FromMilliseconds(0);
                    if (currentFrame == 0)
                    {
                        AnimationComplete?.Invoke(this, null);
                    }
                    if (shouldLoop == false && currentFrame == 0)
                    {
                        animationEnd();
                        return;
                    }
                }
            }
        }
Exemple #3
0
 private void TimerTick(object sender, EventArgs e)
 {
     if (currentFrame++ >= frames.Length - 1)
     {
         currentFrame = 0;
         AnimationComplete?.Invoke(this, EventArgs.Empty);
     }
 }
 protected override void OnAnimationComplete()
 {
     Timer.Stop();
     AnimationComplete?.Invoke();
 }