Class GameBackgroundDisplay

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

public class GameBackgroundDisplay extends UIComponent
Displays the background for the main game area.
  • Field Details

    • timePerFrame

      protected float timePerFrame
    • timeSinceLastUpdate

      protected long timeSinceLastUpdate
    • currentImage

      protected String currentImage
    • currentImageIndex

      protected int currentImageIndex
    • BACKGROUND_TEXTURES

      protected static final String[] BACKGROUND_TEXTURES
  • Constructor Details

    • GameBackgroundDisplay

      public GameBackgroundDisplay()
  • Method Details

    • getCurrentImage

      public String getCurrentImage()
    • getTable

      public com.badlogic.gdx.scenes.scene2d.ui.Table getTable()
    • setTable

      public void setTable(com.badlogic.gdx.scenes.scene2d.ui.Table table)
    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class UIComponent
    • setBackground

      public void setBackground()
      sets the background with the image currently stored in currentImage member variable
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Description copied from class: RenderComponent
      Draw the renderable. Should be called only by the renderer, not manually.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • setStage

      public void setStage(com.badlogic.gdx.scenes.scene2d.Stage mock)
    • update

      public void update()
      Updates the background image to the next frame in the cycle
      Overrides:
      update in class Component