Class Debug


  • public class Debug
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.newdawn.slick.Color backgroundColor
      Color for the background of debug lines
      private static org.newdawn.slick.Font font
      Font to use while rendering debug lines
      private static int lx
      Initial line x-coordinate
      private static int ly
      Initial line y-coordinate
      private static int row
      What row to render the line on, for drawLine(String, Graphics)
      private static int rowOffset
      Offset for each line
      private static byte TEXT_PADDING
      Number of pixels to add as padding around each line of text
    • Constructor Summary

      Constructors 
      Constructor Description
      Debug()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void drawLine​(java.lang.String s, org.newdawn.slick.Graphics graphics)
      Renders the string in the top left corner of the screen
      static void error​(java.lang.Exception e)
      Handles the exception, printing out its message
      static void error​(java.lang.Object object)
      Prints the given object to the console with the tag "ERROR"
      static void info​(java.lang.Object object)
      Prints the given object to the console with the tag "INFO"
      static void out​(java.lang.Object object)
      Prints the given object to the console, along with the current thread and time
      static void render​(org.newdawn.slick.Graphics graphics)
      Display debug information, toggled with F3
      static void warning​(java.lang.Object object)
      Prints the given object to the console with the tag "WARNING"
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • font

        private static final org.newdawn.slick.Font font
        Font to use while rendering debug lines
      • backgroundColor

        private static final org.newdawn.slick.Color backgroundColor
        Color for the background of debug lines
      • TEXT_PADDING

        private static final byte TEXT_PADDING
        Number of pixels to add as padding around each line of text
        See Also:
        Constant Field Values
    • Constructor Detail

      • Debug

        public Debug()
    • Method Detail

      • out

        public static void out​(java.lang.Object object)
        Prints the given object to the console, along with the current thread and time
        Parameters:
        object - The object to print out
      • info

        public static void info​(java.lang.Object object)
        Prints the given object to the console with the tag "INFO"
        Parameters:
        object - The object to print out
      • warning

        public static void warning​(java.lang.Object object)
        Prints the given object to the console with the tag "WARNING"
        Parameters:
        object - The object to print out
      • error

        public static void error​(java.lang.Object object)
        Prints the given object to the console with the tag "ERROR"
        Parameters:
        object - The object to print out
      • error

        public static void error​(java.lang.Exception e)
        Handles the exception, printing out its message
        Parameters:
        e - The exception to handle
        See Also:
        Throwable.getMessage()
      • drawLine

        private static void drawLine​(java.lang.String s,
                                     org.newdawn.slick.Graphics graphics)
        Renders the string in the top left corner of the screen
        Parameters:
        s - The string to display
        graphics - Graphics to use
      • render

        public static void render​(org.newdawn.slick.Graphics graphics)
        Display debug information, toggled with F3