FarseerPhysics.ScreenSystem.GameScreen.UpdateTransition C# (CSharp) Метод

UpdateTransition() приватный Метод

Helper for updating the screen transition position.
private UpdateTransition ( GameTime gameTime, System.TimeSpan time, int direction ) : bool
gameTime Microsoft.Xna.Framework.GameTime
time System.TimeSpan
direction int
Результат bool
        private bool UpdateTransition(GameTime gameTime, TimeSpan time, int direction)
        {
            // How much should we move by?
            float transitionDelta;

            if (time == TimeSpan.Zero)
                transitionDelta = 1;
            else
                transitionDelta = (float)(gameTime.ElapsedGameTime.TotalMilliseconds / time.TotalMilliseconds);

            // Update the transition position.
            TransitionPosition += transitionDelta * direction;

            // Did we reach the end of the transition?
            if ((TransitionPosition <= 0) || (TransitionPosition >= 1))
            {
                TransitionPosition = MathHelper.Clamp(TransitionPosition, 0, 1);
                return false;
            }
            // Otherwise we are still busy transitioning.
            return true;
        }