Skip to content

DirectionalLight Class

SoJS coder edited this page Dec 11, 2023 · 3 revisions

DirectionalLight

The directional light class allows you to create directional lights (lights that face a certain direction in space)

Constructor

Parameters

new DirectionalLight(position, angle, spread, diffuse, strength, color)

  • position (Array): Vector representing the lights position in 2d space (x,y)
  • angle (Number): the angle that the light is facing (in radians)
  • spread (Number): The angle that the light spreads at (in radians)
  • diffuse (Number): How far the light diffuses
  • strength (Number): The strength of the light
  • color (Array): [r,b,b] 0-255
Clone this wiki locally