示例#1
0
        public static void Update()
        {
            MouseState mState = Mouse.GetState();

            //If the position changed, reset the time and update the previous position
            if (mState.Position != PrevMousePos)
            {
                ElapsedMouseTime = 0d;
                PrevMousePos     = mState.Position;
            }
            else
            {
                ElapsedMouseTime = UtilityGlobals.Clamp(ElapsedMouseTime + Time.ElapsedTime.TotalMilliseconds, 0d, MouseHideTime);
            }
        }
        protected void Progress()
        {
            if (AnimType == AnimTypes.Normal)
            {
                CurFrameIndex = UtilityGlobals.Clamp(CurFrameIndex + 1, 0, MaxFrameIndex);
            }
            else
            {
                if ((CurFrameIndex + 1) > MaxFrameIndex)
                {
                    Loops++;
                }

                CurFrameIndex = UtilityGlobals.Wrap(CurFrameIndex + 1, 0, MaxFrameIndex);
            }

            ElapsedFrameTime = 0d;

            UpdateSpriteInfo(CurFrame);
        }