Package com.deco2800.game.rendering
Class DebugRenderer
java.lang.Object
com.deco2800.game.rendering.DebugRenderer
public class DebugRenderer
extends java.lang.Object
Provides functionality to draw lines/shapes to the screen for debug purposes.
-
Constructor Summary
Constructors Constructor Description DebugRenderer()
DebugRenderer(Box2DDebugRenderer physicsRenderer, ShapeRenderer shapeRenderer)
-
Method Summary
Modifier and Type Method Description void
drawLine(Vector2 from, Vector2 to)
Draw a line between two positionsvoid
drawLine(Vector2 from, Vector2 to, Color color, float lineWidth)
Draw a line between two positionsvoid
drawRectangle(Vector2 pos, Vector2 size)
Draw a rectanglevoid
drawRectangle(Vector2 pos, Vector2 size, Color color, float lineWidth)
Draw a rectangleboolean
getActive()
void
render(Matrix4 projMatrix)
void
renderPhysicsWorld(World physicsWorld)
void
setActive(boolean active)
-
Constructor Details
-
DebugRenderer
public DebugRenderer() -
DebugRenderer
-
-
Method Details
-
renderPhysicsWorld
-
drawLine
Draw a line between two positions- Parameters:
from
- start positionto
- end position
-
drawLine
Draw a line between two positions- Parameters:
from
- start positionto
- end positioncolor
- line colorlineWidth
- line width
-
drawRectangle
Draw a rectangle- Parameters:
pos
- position of bottom left cornersize
- width/height
-
drawRectangle
Draw a rectangle- Parameters:
pos
- position of bottom left cornersize
- width/heightcolor
- line colorlineWidth
- line width
-
setActive
public void setActive(boolean active)- Parameters:
active
- true to enable debug drawing, false to disable
-
getActive
public boolean getActive() -
render
-