Package com.csse3200.game.components
Class FPSDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.FPSDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,Renderable,Comparable<Renderable>
UIComponent for rendering the current FPS in the game.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Creates all widgets to be drawn.voiddispose()Removes the FPS label.voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the FPS label in the top left of the screen.voidupdate()Resets the text inside the FPS label to be current FPS.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndexMethods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render, setLayerMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.csse3200.game.rendering.Renderable
render
-
Constructor Details
-
FPSDisplay
public FPSDisplay()
-
-
Method Details
-
create
public void create()Creates all widgets to be drawn.- Overrides:
createin classUIComponent
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the FPS label in the top left of the screen.- Specified by:
drawin classRenderComponent- Parameters:
batch- Batch to render to.
-
dispose
public void dispose()Removes the FPS label.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classRenderComponent
-
update
public void update()Resets the text inside the FPS label to be current FPS.
-