Class UpgradesTab
java.lang.Object
com.csse3200.game.ui.inventoryscreen.UpgradesTab
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionUpgradesTab(MainGameScreen gameScreen) Creates an Upgrades tab bound to the given main game screen and player entity -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.scenes.scene2d.Actorbuild(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.voiddispose()Disposes all textures owned by this tab.
-
Constructor Details
-
UpgradesTab
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:
buildin interfaceInventoryTabInterface- 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.
-