Class DebugRenderer

java.lang.Object
com.csse3200.game.rendering.DebugRenderer

public class DebugRenderer extends Object
Provides functionality to draw lines/shapes to the screen for debug purposes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DebugRenderer(com.badlogic.gdx.physics.box2d.Box2DDebugRenderer physicsRenderer, com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawLine(com.badlogic.gdx.math.Vector2 from, com.badlogic.gdx.math.Vector2 to)
    Draw a line between two positions
    void
    drawLine(com.badlogic.gdx.math.Vector2 from, com.badlogic.gdx.math.Vector2 to, com.badlogic.gdx.graphics.Color color, float lineWidth)
    Draw a line between two positions
    void
    drawRectangle(com.badlogic.gdx.math.Vector2 pos, com.badlogic.gdx.math.Vector2 size)
    Draw a rectangle
    void
    drawRectangle(com.badlogic.gdx.math.Vector2 pos, com.badlogic.gdx.math.Vector2 size, com.badlogic.gdx.graphics.Color color, float lineWidth)
    Draw a rectangle
    boolean
     
    void
    render(com.badlogic.gdx.math.Matrix4 projMatrix)
     
    void
    renderPhysicsWorld(com.badlogic.gdx.physics.box2d.World physicsWorld)
     
    void
    setActive(boolean active)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DebugRenderer

      public DebugRenderer()
    • DebugRenderer

      public DebugRenderer(com.badlogic.gdx.physics.box2d.Box2DDebugRenderer physicsRenderer, com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer)
  • Method Details

    • renderPhysicsWorld

      public void renderPhysicsWorld(com.badlogic.gdx.physics.box2d.World physicsWorld)
    • drawLine

      public void drawLine(com.badlogic.gdx.math.Vector2 from, com.badlogic.gdx.math.Vector2 to)
      Draw a line between two positions
      Parameters:
      from - start position
      to - end position
    • drawLine

      public void drawLine(com.badlogic.gdx.math.Vector2 from, com.badlogic.gdx.math.Vector2 to, com.badlogic.gdx.graphics.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(com.badlogic.gdx.math.Vector2 pos, com.badlogic.gdx.math.Vector2 size)
      Draw a rectangle
      Parameters:
      pos - position of bottom left corner
      size - width/height
    • drawRectangle

      public void drawRectangle(com.badlogic.gdx.math.Vector2 pos, com.badlogic.gdx.math.Vector2 size, com.badlogic.gdx.graphics.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(com.badlogic.gdx.math.Matrix4 projMatrix)