Class AchievementPopupComponent

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

public class AchievementPopupComponent extends UIComponent
Builds and displays an achievement widget that is displayed momentarily when a player makes a new achievement in the game. The widget is displayed for 5 seconds
  • Field Details

    • COOL_OFF

      public static final long COOL_OFF
      Milliseconds to wait before displaying popups
      See Also:
  • Constructor Details

    • AchievementPopupComponent

      public AchievementPopupComponent()
  • Method Details

    • addListeners

      public void addListeners(EventHandler events)
      Connects the listeners when invoked from handler
      Parameters:
      events - AchievementHandler's service handler
    • create

      public void create()
      Initialises component. Connects to the player achievements event
      Overrides:
      create in class UIComponent
    • dispose

      public void dispose()
      Clean up
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      When the draw method is called we check if the popup queue is not empty and then display the one first in the list. Other popups will get their turn when the ones to be shown timeout
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to. (not used) actors added to stage instead
    • isPopupActive

      public boolean isPopupActive()