Class CurrencyDisplay

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

public class CurrencyDisplay extends UIComponent
A UI component for displaying the currency owned
  • Constructor Details

    • CurrencyDisplay

      public CurrencyDisplay()
  • Method Details

    • create

      public void create()
      Adds actors to stage
      Overrides:
      create in class UIComponent
    • draw

      public 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.
    • updateScrapsStats

      public void updateScrapsStats()
      Updates the currency (Scraps) value on the UI component
    • updateCrystalsStats

      public void updateCrystalsStats()
      Updates the currency (Crystals) value on the UI component
    • currencyPopUp

      public void currencyPopUp(float x, float y, int amount, int offset)
      A label that appears once currency is gained, to give the player visual feedback Also plays sound
      Parameters:
      x - Screen x coordinate
      y - Screen y coordinate
      amount - value to display on the pop-up
      offset - value to offset the height of the label by
    • setCamera

      public void setCamera(com.badlogic.gdx.graphics.Camera camera)
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent