Class AchievementInterface

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

public class AchievementInterface extends UIComponent
Base achievement display class to be extended by achievement type screens
  • Field Details

    • EVENT_OPEN_ACHIEVEMENTS

      public static final String EVENT_OPEN_ACHIEVEMENTS
      Event string for opening the achievement screen
      See Also:
  • Constructor Details

    • AchievementInterface

      public AchievementInterface()
  • Method Details

    • create

      public void create()
      Create the achievement base display
      Overrides:
      create in class UIComponent
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Description copied from class: RenderComponent
      Draw the renderable. Should be called only by the renderer, not manually.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent
    • getMilestoneImageButtonByNumber

      public static com.badlogic.gdx.scenes.scene2d.ui.Image getMilestoneImageButtonByNumber(int milestoneNumber, boolean isComplete, Achievement achievement, com.badlogic.gdx.scenes.scene2d.ui.Label descriptionLabel)
      Creates the milestone button actor. listens on hover events to display milestone achievement in description
      Parameters:
      milestoneNumber - milestoneNumber
      isComplete - whether the milestone is complete
      achievement - the achievement to create the image button for
      descriptionLabel - the description label for the achievement
      Returns:
      an image or
    • buildAchievementMilestoneButtons

      public static com.badlogic.gdx.scenes.scene2d.Group buildAchievementMilestoneButtons(com.badlogic.gdx.scenes.scene2d.Group milestoneButtons, Achievement achievement, com.badlogic.gdx.scenes.scene2d.ui.Label descriptionLabel)
      Constructs the achievement milestone buttons for a given achievement
      Parameters:
      achievement - the achievement to create the buttons for
      descriptionLabel - the label to be changed on hover
      Returns:
      Group of ImageButtons
    • buildAchievementCard

      public com.badlogic.gdx.scenes.scene2d.Group buildAchievementCard(Achievement achievement)
      Builds an achievement card actor read to be displayed
      Parameters:
      achievement - the achievement to create the card for
      Returns:
      the actor (Table)
    • buildAchievementSummaryCard

      public com.badlogic.gdx.scenes.scene2d.Group buildAchievementSummaryCard(AchievementType type)
      Creates an achievement summary card of the provided achievement type
      Parameters:
      type - AchievementType
      Returns:
      Group
    • changeSelectedIcon

      public void changeSelectedIcon()
      Sets all achievement icons to be checked, used for highlighting the selected achievement icon from the navigation panel
    • changeDisplay

      public void changeDisplay(AchievementType type)
      Change displayed achievement badges to those of the provided type. If type is SUMMARY a breakdown of completion of each achievement type will be displayed
      Parameters:
      type - AchievementType
    • addExitButtonEvent

      public void addExitButtonEvent(com.badlogic.gdx.scenes.scene2d.ui.ImageButton button)
      Add listener to provided ImageButton, will close achievement interface
      Parameters:
      button - ImageButton