Class WorldMapNodeRenderComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.worldmap.WorldMapNodeRenderComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
Renders a world map node using the engine's rendering system
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
Fields inherited from class com.csse3200.game.rendering.RenderComponent
colour
-
Constructor Summary
ConstructorsConstructorDescriptionWorldMapNodeRenderComponent
(WorldMapNode node, com.badlogic.gdx.math.Vector2 worldSize, float nodeSize) Constructor for the world map node render component. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.protected void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.void
setShowPrompt
(boolean showPrompt) void
updateProximityState
(WorldMapNode nearbyNode) Updates the proximity state for this node.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, getColour, render, setColour
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPriority, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
WorldMapNodeRenderComponent
public WorldMapNodeRenderComponent(WorldMapNode node, com.badlogic.gdx.math.Vector2 worldSize, float nodeSize) Constructor for the world map node render component.- Parameters:
node
- the node to renderworldSize
- the size of the world mapnodeSize
- the size of the node
-
-
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.- Overrides:
create
in classUIComponent
-
updateProximityState
Updates the proximity state for this node.- Parameters:
nearbyNode
- the node the player is currently near, or null if none
-
draw
protected 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 classRenderComponent
- Parameters:
batch
- Batch to render to.
-
setShowPrompt
public void setShowPrompt(boolean showPrompt)
-