Package com.csse3200.game.rendering
Class BackgroundMapComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.rendering.BackgroundMapComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
Draws a single texture as the world background, positioned at (0,0). Scales to fill the camera
viewport height; width is scaled by aspect.
-
Field Summary
Fields inherited from class com.csse3200.game.rendering.RenderComponent
colour
-
Constructor Summary
ConstructorsConstructorDescriptionBackgroundMapComponent
(com.badlogic.gdx.graphics.Texture texture, float worldHeight) -
Method Summary
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, create, dispose, getColour, render, setColour
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPriority, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
BackgroundMapComponent
public BackgroundMapComponent(com.badlogic.gdx.graphics.Texture texture, float worldHeight)
-
-
Method Details
-
getWorldWidth
public float getWorldWidth() -
getWorldHeight
public float getWorldHeight() -
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 classRenderComponent
- Parameters:
batch
- Batch to render to.
-
getZIndex
public float getZIndex()Description copied from interface:Renderable
Z index controls rendering order within a layer. Higher Z index is drawn on top.- Specified by:
getZIndex
in interfaceRenderable
- Overrides:
getZIndex
in classRenderComponent
- Returns:
- Z index
-
getLayer
public int getLayer()Description copied from interface:Renderable
Layer to be rendered in. Higher layers will be rendered on top of lower layers.- Specified by:
getLayer
in interfaceRenderable
- Overrides:
getLayer
in classRenderComponent
- Returns:
- layer
-