Class FPSDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class FPSDisplay extends UIComponent
UIComponent for rendering the current FPS in the game.
  • Constructor Details

    • FPSDisplay

      public FPSDisplay()
  • Method Details

    • create

      public void create()
      Creates all widgets to be drawn.
      Overrides:
      create in class UIComponent
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draws the FPS label in the top left of the screen.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • dispose

      public void dispose()
      Removes the FPS label.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent
    • update

      public void update()
      Resets the text inside the FPS label to be current FPS.
      Overrides:
      update in class Component