コード例 #1
0
        /// <summary>
        /// call this eatch frame to check if the animation should move to the next frame, it will update if its time
        /// </summary>
        /// <returns>true if last frame is done showing</returns>
        public bool AnimationUpdate()
        {
            if (StaticTools.TimerPassed(frameTimer))
            {
                frameTimer = StaticTools.TimerSet(frameTimeMs);

                if (++currentFrame >= this.GetAnimationLength())
                {
                    currentFrame--;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }
コード例 #2
0
 /// <summary>
 /// Starts the Animation from the first frame
 /// </summary>
 public void AnimationStart()
 {
     frameTimer   = StaticTools.TimerSet(frameTimeMs);
     currentFrame = 0;
 }