Sun light (Also known as directional light) is a single light source that shines from a relative position across the entirety of a world.
Controlling Sun Light
The sun light, which is called directional light, is controlled through a World instance. We're able to control its color, intensity and position.
The sun light's properties can be changed at anytime during gameplay.
Here's how we can change a world's sun light color.
world.setDirectionalLightColor({ r: 255, g: 0, b: 0 }); // A red sun light
Here's how we can change a world's sun light intensity. Intensity can be a value from 0 to 1+, with 1 being the default brightness, and anything above that being additional brightness.
world.setDirectionalLightIntensity(10); // Very bright lighting
And finally, here's how can update the sun light's position that the light of it directionally emits from across a world.