Package com.csse3200.game.rendering
Class RenderService
java.lang.Object
com.csse3200.game.rendering.RenderService
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Globally accessible service for registering renderable components. Any renderable registered with
this service has render() called once per frame.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
getDebug()
com.badlogic.gdx.scenes.scene2d.Stage
getStage()
void
register
(Renderable renderable) Register a new renderable.void
render
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Trigger rendering on the given batch.void
setDebug
(DebugRenderer debugRenderer) void
setStage
(com.badlogic.gdx.scenes.scene2d.Stage stage) void
unregister
(Renderable renderable) Unregister a renderable.
-
Constructor Details
-
RenderService
public RenderService()
-
-
Method Details
-
register
Register a new renderable.- Parameters:
renderable
- new renderable.
-
unregister
Unregister a renderable.- Parameters:
renderable
- renderable to unregister.
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Trigger rendering on the given batch. This should be called only from the main renderer.- Parameters:
batch
- batch to render to.
-
setStage
public void setStage(com.badlogic.gdx.scenes.scene2d.Stage stage) -
getStage
public com.badlogic.gdx.scenes.scene2d.Stage getStage() -
setDebug
-
getDebug
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-