Class LightService

java.lang.Object
com.csse3200.game.services.LightService

public class LightService extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a LightService which is accessed via the ServiceLocator and used to create lights
  • Method Summary

    Modifier and Type
    Method
    Description
    box2dLight.RayHandler
    Getter method for the ray handler
    void
    Renders the lighting involved in the game and sets the ambient light to be based on the time of day
    void
    setBrightnessMultiplier(float brightnessMultiplier)
    Sets the global ambient brightness multiplier.
    void
    setColourOffset(com.badlogic.gdx.graphics.Color colourOffset)
    Sets the global ambient colour offset.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LightService

      public LightService()
      Creates a LightService which is accessed via the ServiceLocator and used to create lights
  • Method Details

    • renderLight

      public void renderLight()
      Renders the lighting involved in the game and sets the ambient light to be based on the time of day
    • getRayHandler

      public box2dLight.RayHandler getRayHandler()
      Getter method for the ray handler
      Returns:
      ray handler instance used for creating lights
    • setColourOffset

      public void setColourOffset(com.badlogic.gdx.graphics.Color colourOffset)
      Sets the global ambient colour offset. This offset will be added to the global ambient lighting (after any brightness multipliers are applied).
      Parameters:
      colourOffset - The global ambient light colour offset. Set to Color.CLEAR for default.
    • setBrightnessMultiplier

      public void setBrightnessMultiplier(float brightnessMultiplier)
      Sets the global ambient brightness multiplier. This multiplier will pre-multiply the global brightness (before any global brightness offsets are added.
      Parameters:
      brightnessMultiplier - The global ambient light brightness multiplier. Set to 1 for regular.