Class LightBuilder

java.lang.Object
com.devcharles.piazzapanic.utility.box2d.LightBuilder

public class LightBuilder extends Object
Helper class that stores light definitions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.

    Methods inherited from class java.lang.Object

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

  • 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 coordinates
      y - y-position in world coordinates
      c - 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 coordinates
      y - y-position in world coordinates
      c - Colour of the light.
      dist - distance of light, how far does it reach.
      xray - If true, light will bleed trough objects
      Returns:
      PointLight reference.