Esempio n. 1
0
        /// <summary>
        /// returns true if we are done with this debug draw item
        /// </summary>
        public bool Draw(Batcher batcher)
        {
            switch (drawType)
            {
            case DebugDrawType.Line:
                batcher.DrawLine(Start, End, Color);
                break;

            case DebugDrawType.HollowRectangle:
                batcher.DrawHollowRect(Rectangle, Color);
                break;

            case DebugDrawType.Pixel:
                batcher.DrawPixel(X, Y, Color, Size);
                break;

            case DebugDrawType.BitmapFontText:
                batcher.DrawString(BitmapFont, Text, Position, Color, 0f, Vector2.Zero, Scale,
                                   SpriteEffects.None, 0f);
                break;

            case DebugDrawType.SpriteFontText:
                batcher.DrawString(SpriteFont, Text, Position, Color, 0f, Vector2.Zero, new Vector2(Scale),
                                   SpriteEffects.None, 0f);
                break;

            case DebugDrawType.ConsoleText:
                batcher.DrawString(BitmapFont, Text, Position, Color, 0f, Vector2.Zero, Scale,
                                   SpriteEffects.None, 0f);
                break;

            case DebugDrawType.Circle:
                batcher.DrawCircle(X, Y, Radius, Color);
                break;
            }

            Duration -= Time.DeltaTime;

            return(Duration < 0f);
        }