Class GameMetrics

java.lang.Object
de.gurkenlabs.litiengine.GameMetrics
All Implemented Interfaces:
IRenderable

public final class GameMetrics extends Object implements IRenderable
The class GameMetrics provides meta information about the game's metrics. This allows the developer to get a feeling about the performance of different aspects (e.g. memory consumption, potential fps, network traffic, ...) and to identify potential issues.

This information can be rendered as debug information if configured to get live data during a gameplay session.

See Also:
  • Method Details

    • getFramesPerSecond

      public int getFramesPerSecond()
    • getUsedMemory

      public float getUsedMemory()
    • getRenderColor

      public Color getRenderColor()
    • trackRenderTime

      public void trackRenderTime(String name, double renderTime, GameMetrics.RenderInfo... infos)
    • render

      public void render(Graphics2D g)
      Description copied from interface: IRenderable
      Renders the visual contents of this instance onto the provided graphics context.

      If an Entity implements this interface, this method will be called right after the entity was rendered from the environment. Allowing for a custom rendering mechanism.

      This interface can be implemented in general by anything that should be rendered to the game's screen.

      Specified by:
      render in interface IRenderable
      Parameters:
      g - The current graphics object onto which this instance will render its visual contents.
      See Also:
    • setRenderColor

      public void setRenderColor(Color color)
      Sets the color that is used when rendering the metrics if cl_showGameMetrics = true.
      Parameters:
      color - The color for rendering the metrics.
      See Also: