Class ShopScreenDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.screens.ShopScreenDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
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.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
ConstructorsConstructorDescriptionShopScreenDisplay
(ForestGameArea area, ShopManager manager) UI component that displays the shop screen Allows player to interact with the shop and displays relevant error messages. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Creates a new ShopScreen Display and sets up UI componentsvoid
dispose()
Cleans up resources and disposes of UI elements.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw method overriddencom.badlogic.gdx.scenes.scene2d.Stage
getStage()
Returns the Stage associated with the shop screenvoid
hide()
Hides the shop screen and resumes game time.void
show()
Shows the shop screen.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, disableComponent, enableComponent, isDisabled, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.csse3200.game.rendering.Renderable
render
-
Constructor Details
-
ShopScreenDisplay
UI component that displays the shop screen Allows player to interact with the shop and displays relevant error messages.- Parameters:
area
- Game area containing playermanager
- Shop manager to handle purchases
-
-
Method Details
-
create
public void create()Creates a new ShopScreen Display and sets up UI components- Overrides:
create
in classUIComponent
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw method overridden- Specified by:
draw
in classRenderComponent
- 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 interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-
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.
-