Class UpgradesTab

java.lang.Object
com.csse3200.game.ui.inventoryscreen.UpgradesTab
All Implemented Interfaces:
InventoryTabInterface

public class UpgradesTab extends Object implements InventoryTabInterface
Pause-menu tab that renders the Upgrades UI. The tab: Displays an upgrades-selected.png background via PixelPerfectPlacer Adds an invisible close hotspot positioned in background pixel space. Renders the player sprite centered on the tab, offset from the top by #PLAYER_TOP_Y Optionally underlays a “pack” beneath the player if the upgrades bag contains either "jetpack" or "glider". If both are present, jetpack wins Provides invisible hotspots for switching to Inventory/Objectives tabs
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an Upgrades tab bound to the given main game screen and player entity
  • Method Summary

    Modifier and Type
    Method
    Description
    com.badlogic.gdx.scenes.scene2d.Actor
    build(com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
    Builds the Upgrades tab as a centered, aspect preserving canvas Scales the canvas to 2/3 of screen height; width derived from #BASE_ASPECT Overlays invisible hotspots for close and tab switches.
    void
    Disposes all textures owned by this tab.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UpgradesTab

      public UpgradesTab(MainGameScreen gameScreen)
      Creates an Upgrades tab bound to the given main game screen and player entity
      Parameters:
      gameScreen - the owning game screen (used to toggle pause/panels)
  • Method Details

    • build

      public com.badlogic.gdx.scenes.scene2d.Actor build(com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
      Builds the Upgrades tab as a centered, aspect preserving canvas Scales the canvas to 2/3 of screen height; width derived from #BASE_ASPECT Overlays invisible hotspots for close and tab switches. Draws player (always) and optionally the pack (jetpack/glider) beneath.
      Specified by:
      build in interface InventoryTabInterface
      Parameters:
      skin - scene2d skin (not used for visuals here, but required by the interface)
      Returns:
      root actor to add to the stage
    • dispose

      public void dispose()
      Disposes all textures owned by this tab. Call when the tab is no longer needed to free GPU resources.