Class MinimapComponent

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

public class MinimapComponent extends RenderComponent
  • Constructor Details

    • MinimapComponent

      public MinimapComponent(com.badlogic.gdx.maps.tiled.TiledMap map, com.badlogic.gdx.graphics.OrthographicCamera camera)
      Create a new MinimapComponent, with a TiledMap to render and the game's camera
      Parameters:
      map - TiledMap representing the game to be rendered
      camera - Game camera
  • Method Details

    • 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.
    • getZIndex

      public float getZIndex()
      Gets Z index of Minimap - 0 (higher Z in layer 1 drawn on top)
      Specified by:
      getZIndex in interface Renderable
      Overrides:
      getZIndex in class RenderComponent
      Returns:
      z index
    • getLayer

      public int getLayer()
      Minimap instantiated on layer 2 to draw over terrain and player
      Specified by:
      getLayer in interface Renderable
      Overrides:
      getLayer in class RenderComponent
      Returns:
      layer of minimap - 2
    • compareTo

      public int compareTo(Renderable o)
      Specified by:
      compareTo in interface Comparable<Renderable>
      Overrides:
      compareTo in class RenderComponent
    • 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