Class ShopScreenDisplay

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

public class ShopScreenDisplay extends UIComponent
Screen which displays the shop screen.

Displays purchasable items which are clickable and trigger a purchase event. Displays current balance as well as error messages.

  • Constructor Details

    • ShopScreenDisplay

      public ShopScreenDisplay(ForestGameArea area, ShopManager manager)
      UI component that displays the shop screen Allows player to interact with the shop and displays relevant error messages.
      Parameters:
      area - Game area containing player
      manager - Shop manager to handle purchases
  • Method Details

    • create

      public void create()
      Creates a new ShopScreen Display and sets up UI components
      Overrides:
      create in class UIComponent
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draw method overridden
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • getStage

      public com.badlogic.gdx.scenes.scene2d.Stage getStage()
      Returns the Stage associated with the shop screen
      Returns:
      the stage object
    • dispose

      public void dispose()
      Cleans up resources and disposes of UI elements.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent
    • show

      public void show()
      Shows the shop screen. Pauses the game, refreshes the catalog, and updates balance display
    • hide

      public void hide()
      Hides the shop screen and resumes game time.