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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called when the entity is created and registered.voiddispose()Called when the component is disposed.voidsetMarker(com.badlogic.gdx.scenes.scene2d.ui.Image marker) Updates the marker on the minimap with a new drawable.setScale(float scale) setScaleX(float sx) setScaleY(float sy) voidtintMarker(com.badlogic.gdx.graphics.Color color) Tints the marker on the minimap with a new color.voidupdate()Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
MinimapComponent
- Parameters:
markerAsset- The path to the texture for this entity's marker.
-
-
Method Details
-
create
public void create()Description copied from class:ComponentCalled 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. -
update
public void update()Description copied from class:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
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.
-
setScaleX
-
setScaleY
-
setScale
-
dispose
public void dispose()Description copied from class:ComponentCalled when the component is disposed. Dispose of any internal resources here.
-