Class DevTools



  • public class DevTools
    extends java.lang.Object
    Shows data for developers. Also has some tools like buttons to edito the map.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int maxStepsVisualized  
      static int WIDTH
      The visualised width of every data
    • Constructor Summary

      Constructors 
      Constructor Description
      DevTools​(int xPos, int yPos)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear​()
      sets the frame time of every frame to 0
      float getAverageDelta​()
      Returns the average delta time over every recorded frame.
      float getAverageDelta​(int lastNSteps)
      Get the avererage raw delta time over the last n steps
      java.lang.String getDataAsString​(int everyNthn)
      CSV (RFC 4180) compliant.
      int getLeftOffset​()  
      float getSavedDelta​(int pos)
      Get a recorded frame time value.
      int getTopOffset​()  
      int getWidth​()
      Width of FPS diag.
      boolean isVisible​()
      Is the diagramm visible?
      void render​(GameView view)
      Renders the diagramm.
      void setCapacity​(int cap)
      the amount of frame times stored
      void setVisible​(boolean visible)
      Set the FPSdiag visible.
      void update​()
      Updates the diagramm
      • Methods inherited from class java.lang.Object

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

      • DevTools

        public DevTools​(int xPos,
                        int yPos)
        Parameters:
        xPos - the position of the diagram from left
        yPos - the position of the diagram from top
    • Method Detail

      • setCapacity

        public void setCapacity​(int cap)
        the amount of frame times stored
        Parameters:
        cap -
      • clear

        public void clear​()
        sets the frame time of every frame to 0
      • update

        public void update​()
        Updates the diagramm
      • render

        public void render​(GameView view)
        Renders the diagramm. The batches should be closed before calling this method.
        Parameters:
        view - if from class EditorView removes or shows the buttons
      • getSavedDelta

        public float getSavedDelta​(int pos)
        Get a recorded frame time value. The time between savings is at least the timeStepMin.
        Parameters:
        pos - the array position
        Returns:
        time in s
      • getAverageDelta

        public float getAverageDelta​()
        Returns the average delta time over every recorded frame.
        Returns:
        time in s
      • getAverageDelta

        public float getAverageDelta​(int lastNSteps)
        Get the avererage raw delta time over the last n steps
        Parameters:
        lastNSteps -
        Returns:
        time in s
      • isVisible

        public boolean isVisible​()
        Is the diagramm visible?
        Returns:
      • setVisible

        public void setVisible​(boolean visible)
        Set the FPSdiag visible. You must nevertheless call render(GameView) once a frame to let it appear.
        Parameters:
        visible -
      • getLeftOffset

        public int getLeftOffset​()
        Returns:
      • getTopOffset

        public int getTopOffset​()
        Returns:
        Y-Up
      • getWidth

        public int getWidth​()
        Width of FPS diag.
        Returns:
        in pixels
      • getDataAsString

        public java.lang.String getDataAsString​(int everyNthn)
        CSV (RFC 4180) compliant.
        Parameters:
        everyNthn - take every n-th data
        Returns:
        in ms