public final class GameMetrics extends java.lang.Object implements IRenderable
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
GameMetrics.RenderInfo |
class |
GameMetrics.RenderMetrics |
| Modifier and Type | Method and Description |
|---|---|
float |
getDownStreamInBytes() |
int |
getFramesPerSecond() |
int |
getPackagesReceived() |
int |
getPackagesSent() |
long |
getPing() |
java.awt.Color |
getRenderColor() |
float |
getUpStreamInBytes() |
float |
getUsedMemory() |
void |
packageReceived(long size) |
void |
packageSent(long size) |
void |
render(java.awt.Graphics2D g)
Renders the visual contents of this instance onto the provided graphics context.
|
void |
setPing(long ping) |
void |
setRenderColor(java.awt.Color color)
Sets the color that is used when rendering the metrics if
cl_showGameMetrics = true. |
void |
trackRenderTime(java.lang.String name,
double renderTime,
GameMetrics.RenderInfo... infos) |
public float getDownStreamInBytes()
public int getFramesPerSecond()
public int getPackagesReceived()
public int getPackagesSent()
public long getPing()
public float getUpStreamInBytes()
public float getUsedMemory()
public java.awt.Color getRenderColor()
public void packageReceived(long size)
public void packageSent(long size)
public void trackRenderTime(java.lang.String name,
double renderTime,
GameMetrics.RenderInfo... infos)
public void render(java.awt.Graphics2D g)
IRenderable
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.
render in interface IRenderableg - The current graphics object onto which this instance will render its visual contents.RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)public void setPing(long ping)
public void setRenderColor(java.awt.Color color)
cl_showGameMetrics = true.color - The color for rendering the metrics.ClientConfiguration.showGameMetrics(),
render(Graphics2D)