Class CombatStatsChangePopup

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

public class CombatStatsChangePopup extends UIComponent
A popup UI that displays multiple popup messages when stats change.
  • Constructor Details

    • CombatStatsChangePopup

      public CombatStatsChangePopup()
  • Method Details

    • create

      public void create()
      Initializes the component.
      Overrides:
      create in class UIComponent
    • 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 stats
      isPlayer - 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 health
      hungerChange - the numeric change in hunger
      playerStats - 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 class RenderComponent
      Parameters:
      batch - The SpriteBatch used for drawing.
    • dispose

      public void dispose()
      Disposes of all remaining popup messages.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent