Class CombatStatsChangePopup
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.combat.CombatStatsChangePopup
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
A popup UI that displays multiple popup messages when stats change.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Initializes the component.void
createHealthStatsChangePopup
(int statsDiff, boolean isPlayer) Convert numeric health stats changes to string with polarity and select the text colorvoid
createStatusEffectStatsChangePopup
(int healthChange, int hungerChange, CombatStatsComponent playerStats) Create stats change popups for changes caused by Boss Special Move status effects.void
dispose()
Disposes of all remaining popup messages.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the popups if any are displayed.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex, setStage
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, 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
-
CombatStatsChangePopup
public CombatStatsChangePopup()
-
-
Method Details
-
create
public void create()Initializes the component.- Overrides:
create
in classUIComponent
-
createHealthStatsChangePopup
public void createHealthStatsChangePopup(int statsDiff, boolean isPlayer) Convert numeric health stats changes to string with polarity and select the text color- Parameters:
statsDiff
- the numeric change in statsisPlayer
- whether to display the stats changes around the player or enemy
-
createStatusEffectStatsChangePopup
public void createStatusEffectStatsChangePopup(int healthChange, int hungerChange, CombatStatsComponent playerStats) Create stats change popups for changes caused by Boss Special Move status effects. This type of popup will also display the status effect name with its unique text color.- Parameters:
healthChange
- the numeric change in healthhungerChange
- the numeric change in hungerplayerStats
- the CombatStatsComponent containing data about status effects currently applied to the player
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the popups if any are displayed.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- The SpriteBatch used for drawing.
-
dispose
public void dispose()Disposes of all remaining popup messages.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-