Package com.csse3200.game.rendering
Class Renderer
java.lang.Object
com.csse3200.game.rendering.Renderer
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Core rendering system for the game. Controls the game's camera and runs rendering on all
renderables each frame.
-
Constructor Summary
ConstructorDescriptionRenderer
(CameraComponent camera) Create a new renderer with default settingsRenderer
(CameraComponent camera, float gameWidth, com.badlogic.gdx.graphics.g2d.SpriteBatch batch, com.badlogic.gdx.scenes.scene2d.Stage stage, RenderService renderService, DebugRenderer debugRenderer) Create a renderer -
Method Summary
-
Constructor Details
-
Renderer
Create a new renderer with default settings- Parameters:
camera
- camera to render to
-
Renderer
public Renderer(CameraComponent camera, float gameWidth, com.badlogic.gdx.graphics.g2d.SpriteBatch batch, com.badlogic.gdx.scenes.scene2d.Stage stage, RenderService renderService, DebugRenderer debugRenderer) Create a renderer- Parameters:
camera
- Camera to use for rendering.gameWidth
- Desired game width in metres the screen should show. Height is then based on * the aspect ratio.batch
- Batch to render to.stage
- Scene2D stage for UI renderingrenderService
- Render service to usedebugRenderer
- Debug renderer to render
-
-
Method Details
-
getCamera
-
render
public void render()Render everything to the render service. -
resize
public void resize(int width, int height) Resize the renderer to a new screen size.- Parameters:
width
- new screen widthheight
- new screen height
-
getDebug
- Returns:
- The debug renderer attached to this renderer
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-
getStage
public com.badlogic.gdx.scenes.scene2d.Stage getStage()
-