Beta
Position of the light in the world. [x,y]
Angle of the light, in radians
The spread of the light, in radians
How far the light diffuses, in pixels
The strength of the light.
The color of the light, [r,g,b]. By defualt is [255, 255, 255] (white)
Angle of the light (in radians)
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.
Object to pin the light's angle to. Null by default.
Coordinates of the light
Spread of the light (in radians)
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
Pins the angle of the light toward a given GameObject
GameObject to pin the light's angle to (points the light to the center of the object)
Point the light to a certain object
Object to point the light to
Canvas that the light is being rendered on (used for calculating the angle)
Generated using TypeDoc
Classdesc
DirectionalLight class, used for creating directional lights in the scene
Devnote
Directional lights are not fully implemented yet. They are not recommended for use.
Example