Class EntityIndicator

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

public class EntityIndicator extends UIComponent
A UI component responsible for indicating the direction of an entity which is off-screen
  • Constructor Details

    • EntityIndicator

      public EntityIndicator(Entity entity)
      Initialise a new indicator for the given entity
      Parameters:
      entity - : the entity which will be tracked
    • EntityIndicator

      public EntityIndicator(Entity entity, String indicatorAssetPath)
      Initialise a new indicator for the given entity
      Parameters:
      entity - : the entity which will be tracked
      indicatorAssetPath - : path for the indicator asset
  • Method Details

    • create

      public void create()
      Creates the UI and stages the actors
      Overrides:
      create in class UIComponent
    • update

      public void update()
      Updates the indicator postion on the UI
      Overrides:
      update in class Component
    • updateIndicator

      public void updateIndicator()
      Calculates where the entity should be positioned along the edge of the screen
    • 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()
      Disposes the indicator from the screen
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent