Package com.deco2800.game.areas.terrain
Class MinimapComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.rendering.RenderComponent
com.deco2800.game.areas.terrain.MinimapComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,Renderable,Comparable<Renderable>
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMinimapComponent(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 -
Method Summary
Modifier and TypeMethodDescriptionintvoiddispose()Called when the component is disposed.voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.intgetLayer()Minimap instantiated on layer 2 to draw over terrain and playerfloatGets Z index of Minimap - 0 (higher Z in layer 1 drawn on top)Methods inherited from class com.deco2800.game.rendering.RenderComponent
create, renderMethods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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 renderedcamera- Game camera
-
-
Method Details
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponentDraw the renderable. Should be called only by the renderer, not manually.- Specified by:
drawin classRenderComponent- 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:
getZIndexin interfaceRenderable- Overrides:
getZIndexin classRenderComponent- Returns:
- z index
-
getLayer
public int getLayer()Minimap instantiated on layer 2 to draw over terrain and player- Specified by:
getLayerin interfaceRenderable- Overrides:
getLayerin classRenderComponent- Returns:
- layer of minimap - 2
-
compareTo
- Specified by:
compareToin interfaceComparable<Renderable>- Overrides:
compareToin classRenderComponent
-
dispose
public void dispose()Description copied from class:ComponentCalled when the component is disposed. Dispose of any internal resources here.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classRenderComponent
-