Class PlantInfoDisplayComponent

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

public class PlantInfoDisplayComponent extends UIComponent
A UI component for displaying information about a plant.
  • Constructor Details

    • PlantInfoDisplayComponent

      public PlantInfoDisplayComponent()
  • Method Details

    • create

      public void create()
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class UIComponent
    • madeFirstContact

      public void madeFirstContact()
      Marks that the first contact has been made with the plant.
    • getMadeFirstContact

      public boolean getMadeFirstContact()
      Whether first contact has been made or not
      Returns:
      True if first contact has been made, false otherwise
    • showPlantInfo

      public void showPlantInfo(String plantName, String plantInfo)
      Display the string of plant information in the window. This information is provided by the plant component and is already formatted. This occurs when the player hovers their mouse cursor over a plant.
      Parameters:
      plantName - The name of the plant.
      plantInfo - - Information about the current state of the plant.
    • clearInfo

      public void clearInfo()
      Clears the window of any plant information.
    • makeFirstContactWindow

      public void makeFirstContactWindow()
      Create and display the window for first contact with the plant.
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Has no use in this component but is required by the UIComponent class.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component