Class MinimapComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.minimap.MinimapComponent
A component to be added to entities that should be tracked on the minimap.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMinimapComponent
(com.badlogic.gdx.scenes.scene2d.ui.Image marker) MinimapComponent
(String markerAsset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.void
dispose()
Called when the component is disposed.void
setMarker
(com.badlogic.gdx.scenes.scene2d.ui.Image marker) Updates the marker on the minimap with a new drawable.void
tintMarker
(com.badlogic.gdx.graphics.Color color) Tints the marker on the minimap with a new color.Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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
- 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. -
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.
-