Class RenderService

java.lang.Object
com.csse3200.game.rendering.RenderService
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class RenderService extends Object implements 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 Details

    • RenderService

      public RenderService()
  • Method Details

    • register

      public void register(Renderable renderable)
      Register a new renderable.
      Parameters:
      renderable - new renderable.
    • unregister

      public void unregister(Renderable renderable)
      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

      public void setDebug(DebugRenderer debugRenderer)
    • getDebug

      public DebugRenderer getDebug()
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable