Class BackgroundRenderComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.rendering.TextureRenderComponent
com.csse3200.game.components.cutscenes.BackgroundRenderComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
BackgroundRenderComponent is a specialized component for rendering background textures.
It extends TextureRenderComponent and sets a default layer for the background rendering.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBackgroundRenderComponent
(String texturePath) Constructor that initializes the background with a texture path. -
Method Summary
Modifier and TypeMethodDescriptionint
getLayer()
Overrides the getLayer method to return the default layer.Methods inherited from class com.csse3200.game.rendering.TextureRenderComponent
draw, getHeight, getTexture, getTexturePath, getWidth, scaleEntity, setStage, setTexture
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, create, dispose, getZIndex, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
BackgroundRenderComponent
Constructor that initializes the background with a texture path.- Parameters:
texturePath
- the file path of the texture to be rendered as the background.
-
-
Method Details
-
getLayer
public int getLayer()Overrides the getLayer method to return the default layer. This ensures that the background is always rendered on the specified layer.- Specified by:
getLayer
in interfaceRenderable
- Overrides:
getLayer
in classTextureRenderComponent
- Returns:
- the layer on which the background should be rendered.
-