Class RenderUtil

java.lang.Object
com.deco2800.game.utils.RenderUtil

public class RenderUtil extends Object
Graphic utilities to help with rendering
  • Method Details

    • renderInPixels

      public void renderInPixels(com.badlogic.gdx.graphics.g2d.Batch batch, Runnable runnable)
      Temporarily swaps your projection to allow rendering in pixels. This expects a callback function
      Parameters:
      batch - the batch to draw onto
      runnable - a callback method that includes draw calls
    • getScreenHeight

      public int getScreenHeight()
      Utility to get screen height
      Returns:
      the screen height in pixels
    • getCameraComponent

      public CameraComponent getCameraComponent()
      Uses EntityService to fetch the "camera" entity from which the camera component can then be located.
      Returns:
      the located camera component
    • getPixelsPerUnit

      public float getPixelsPerUnit()
      Calculates and returns the pixels per unit required
      Returns:
      pixels per unit
    • getInstance

      public static RenderUtil getInstance()