Package com.csse3200.game.rendering
Class ParallaxBackgroundComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.rendering.ParallaxBackgroundComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionParallaxBackgroundComponent
(com.badlogic.gdx.graphics.Camera camera, float mapWidth, float mapHeight) -
Method Summary
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, create, dispose, getZIndex, render, setLayer
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ParallaxBackgroundComponent
public ParallaxBackgroundComponent(com.badlogic.gdx.graphics.Camera camera, float mapWidth, float mapHeight)
-
-
Method Details
-
addLayer
public void addLayer(com.badlogic.gdx.graphics.Texture texture, float factor) -
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.
-
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
-