Class DevTools
- java.lang.Object
-
- com.bombinggames.wurfelengine.core.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 0float
getAverageDelta()
Returns the average delta time over every recorded frame.float
getAverageDelta(int lastNSteps)
Get the avererage raw delta time over the last n stepsjava.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 storedvoid
setVisible(boolean visible)
Set the FPSdiag visible.void
update()
Updates the diagramm
-
-
-
Field Detail
-
WIDTH
public static final int WIDTH
The visualised width of every data- See Also:
- Constant Field Values
-
maxStepsVisualized
public static final int maxStepsVisualized
- See Also:
- Constant Field Values
-
-
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 classEditorView
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 callrender(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
-
-