Class LightBuilder
java.lang.Object
com.devcharles.piazzapanic.utility.box2d.LightBuilder
Helper class that stores light definitions.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic box2dLight.PointLight
createPointLight
(box2dLight.RayHandler rayHandler, float x, float y, com.badlogic.gdx.graphics.Color c, float dist, boolean soft) Create a point light.static box2dLight.PointLight
createRoomLight
(box2dLight.RayHandler rayHandler, float x, float y, com.badlogic.gdx.graphics.Color c, float dist, boolean xray) Create a softer light to cover the whole room.
-
Field Details
-
rays
private static final int rays- See Also:
-
-
Constructor Details
-
LightBuilder
public LightBuilder()
-
-
Method Details
-
createPointLight
public static box2dLight.PointLight createPointLight(box2dLight.RayHandler rayHandler, float x, float y, com.badlogic.gdx.graphics.Color c, float dist, boolean soft) Create a point light.- Parameters:
rayHandler
- the rayhandler to be added to.x
- x-position in world coordinatesy
- y-position in world coordinatesc
- Colour of the light.dist
- distance of light, how far does it reach.soft
- Enables/disables softness on tips of this light beams- Returns:
PointLight
reference.
-
createRoomLight
public static box2dLight.PointLight createRoomLight(box2dLight.RayHandler rayHandler, float x, float y, com.badlogic.gdx.graphics.Color c, float dist, boolean xray) Create a softer light to cover the whole room.- Parameters:
rayHandler
- the rayhandler to be added to.x
- x-position in world coordinatesy
- y-position in world coordinatesc
- Colour of the light.dist
- distance of light, how far does it reach.xray
- If true, light will bleed trough objects- Returns:
PointLight
reference.
-