Class MinimapComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.minimap.MinimapComponent

public class MinimapComponent extends Component
A component to be added to entities that should be tracked on the minimap.
  • Constructor Details

    • MinimapComponent

      public MinimapComponent(com.badlogic.gdx.scenes.scene2d.ui.Image marker)
      Parameters:
      marker - The image to use for the entity's marker.
    • MinimapComponent

      public MinimapComponent(String markerAsset)
      Parameters:
      markerAsset - The path to the texture for this entity's marker.
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      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 Component
    • setMarker

      public void setMarker(com.badlogic.gdx.scenes.scene2d.ui.Image marker)
      Updates the marker on the minimap with a new drawable.
      Parameters:
      marker - The new drawable for the marker.
    • tintMarker

      public void tintMarker(com.badlogic.gdx.graphics.Color color)
      Tints the marker on the minimap with a new color.
      Parameters:
      color - The new color for the marker.
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component