Package com.csse3200.game.services
Class LightService
java.lang.Object
com.csse3200.game.services.LightService
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a LightService which is accessed via the ServiceLocator and used to create lights -
Method Summary
Modifier and TypeMethodDescriptionbox2dLight.RayHandler
Getter method for the ray handlervoid
Renders the lighting involved in the game and sets the ambient light to be based on the time of dayvoid
setBrightnessMultiplier
(float brightnessMultiplier) Sets the global ambient brightness multiplier.void
setColourOffset
(com.badlogic.gdx.graphics.Color colourOffset) Sets the global ambient colour offset.
-
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 toColor.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.
-