Class Debug

java.lang.Object
buildengine.engine.Debug

public class Debug extends Object
Static class containing debug menu, debug drawing and messages handling.

The Debug menu is drawn on the top-right and drawing information depending on the mode. It also always draws the Object.toString() of the trackers currently active.

Debug lines are lines drawn to represent certain aspects that are invisible by default (like bounding boxes). These can be regulated in this class.

Debug messages are regulated messages and only show up if debug messages are enabled.

  • Field Details

    • VISIBLE_COLOR

      public static final Color VISIBLE_COLOR
    • COLLISION_COLOR

      public static final Color COLLISION_COLOR
    • NO_DRAW

      public static final int NO_DRAW
      Draw nothing
      See Also:
    • FPS_ONLY

      public static final int FPS_ONLY
      Draw the fps
      See Also:
    • FPS_AND_SCENE

      public static final int FPS_AND_SCENE
      Draw the fps and stage
      See Also:
  • Method Details

    • enable

      public static void enable(int drawMode, boolean debugLines, boolean messages)
      Enable debugging and set the settings
      Parameters:
      drawMode - The items to track on top of the screen. Use NO_DRAW, FPS_ONLY or FPS_AND_SCENE. Debug always draws custom trackers.
      debugLines - Enable the debug lines like collision and visibility bounds.
      messages - true - Enable debug messages in the console. false - Don't use console for debug messages
    • msg

      public static void msg(Object s)
      Put a debug message in the console. Only works if debug messages are enabled
      Parameters:
      s - the object, of any kind that allows toString(). Including string objects.
    • track

      public static void track(Object... track)
      Track certain stats in the debug menu.
      Parameters:
      track - the strings to track. Make sure you update this list every time it changes.
    • draw

      public static void draw()
      Draws the debug window. This method is called in the Engine class and is not recommended to use outside of it.
    • isEnableDrawing

      public static boolean isEnableDrawing()
    • getDebugDrawMode

      public static int getDebugDrawMode()
    • isEnableMessages

      public static boolean isEnableMessages()