The position of the light in wolrd space [x,y]
How far the light diffuses, in pixels
The strength of the light. Default is 0.8
The color of the light, [r,g,b]. By defualt is [255, 255, 255] (white)
Color of the light. Format is [r,g,b]. White by default
How much the light diffuses (measured in pixels)
Object to pin the light's position to. Null by default.
Coordinates of the light
Strength of the light. No matter how strong it is, it will never go past the bounds defined by diffuse
Type of the light, either "light" or "directional"
Moves the light by the specified vector
The vector to move the light by
const light = new Light([0, 0], 0.5);
light.move([10, 10]); // moves the light ten pixels to the right and ten pixels down
Moves the light to the center of the specified GameObject (Good for things like lanterns, etc.)
GameObject to move the light's position to
Pins the light's position to a certain GameObject
The GameObject to pin the light to
Generated using TypeDoc
Classdesc
Light class, used for creating lights in the scene
Example
Example