Class Debugger
Provides static methods for drawing basic debug shapes, such as pixels, lines, and squares.
public static class Debugger
- Inheritance
-
Debugger
- Inherited Members
Methods
DrawCircle(SpriteBatch, Point, int, Color, int)
Draws a wireframe circle centered on the given position. The width of the wireframe is 1 pixel.
public static void DrawCircle(SpriteBatch spriteBatch, Point position, int radius, Color color, int width = 1)
Parameters
spriteBatchSpriteBatchMicrosoft.Xna.Framework.Graphics.SpriteBatch
positionPointThe position of the circle
radiusintThe radius of the circle.
colorColorThe color of the circle.
widthintThe width of the circle. Default is 1.
DrawLine(SpriteBatch, Point, Point, Color, int)
Draws a line between two given points. The line is 1 pixel wide.
public static void DrawLine(SpriteBatch spriteBatch, Point start, Point end, Color color, int width = 1)
Parameters
spriteBatchSpriteBatchMicrosoft.Xna.Framework.Graphics.SpriteBatch
startPointThe start point of the line.
endPointThe end point of the line.
colorColorThe color of the line.
widthintThe width of the line. Default is 1.
DrawPixel(SpriteBatch, Point, Color)
Draws a single pixel at the given position.
public static void DrawPixel(SpriteBatch spriteBatch, Point position, Color color)
Parameters
spriteBatchSpriteBatchMicrosoft.Xna.Framework.Graphics.SpriteBatch
positionPointThe position of the pixel.
colorColorThe color of the pixel.
DrawSquare(SpriteBatch, Point, Point, Color, int)
Draws a wireframe square centered on the given position. The width of the wireframe is 1 pixel.
public static void DrawSquare(SpriteBatch spriteBatch, Point position, Point size, Color color, int width = 1)
Parameters
spriteBatchSpriteBatchMicrosoft.Xna.Framework.Graphics.SpriteBatch
positionPointThe position of the square.
sizePointThe size of the square.
colorColorThe color of the square.
widthintThe width of the square. Default is 1.
Initialize(GraphicsDeviceManager)
Initializes the debugging tools by creating a 1x1 white texture used for drawing shapes.
public static void Initialize(GraphicsDeviceManager graphics)
Parameters
graphicsGraphicsDeviceManagerMicrosoft.Xna.Framework.GraphicsDeviceManager