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 Details

  • Method Details

    • renderPhysicsWorld

      public void renderPhysicsWorld​(World physicsWorld)
    • drawLine

      public void drawLine​(Vector2 from, Vector2 to)
      Draw a line between two positions
      Parameters:
      from - start position
      to - end position
    • drawLine

      public void drawLine​(Vector2 from, Vector2 to, Color color, float lineWidth)
      Draw a line between two positions
      Parameters:
      from - start position
      to - end position
      color - line color
      lineWidth - line width
    • drawRectangle

      public void drawRectangle​(Vector2 pos, Vector2 size)
      Draw a rectangle
      Parameters:
      pos - position of bottom left corner
      size - width/height
    • drawRectangle

      public void drawRectangle​(Vector2 pos, Vector2 size, Color color, float lineWidth)
      Draw a rectangle
      Parameters:
      pos - position of bottom left corner
      size - width/height
      color - line color
      lineWidth - line width
    • setActive

      public void setActive​(boolean active)
      Parameters:
      active - true to enable debug drawing, false to disable
    • getActive

      public boolean getActive()
    • render

      public void render​(Matrix4 projMatrix)