light2d component
A 2D light at the node's position. kind is point, directional or spot; the first light2d in a scene drops everything else to the camera's ambient_color.
På denne siden
2d · render · 9 properties · 2D
A 2D light at the node's position. kind is point, directional or spot; the first light2d in a scene drops everything else to the camera's ambient_color.
In a scene, light2d is the node key that applies it. A script reaches each property below as a field on node.light2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.light2d.get() and node.light2d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
color |
color | [1,1,1,1] |
Light colour, as channel floats or #rrggbb / #rrggbbaa |
height |
float | 1 |
How far above the plane a normal-mapped node sees a point or spot light, in world units; lower grazes the bumps. For a directional light, its rise over run: 1 comes in at 45 degrees. Only a node with a normal_map reads it At least 0. |
inner_angle_degrees |
float | 20 |
Half-angle of a spot light's full-brightness cone, in degrees Range 0–179. |
intensity |
float | 1 |
Brightness multiplier; over 1 blows past white At least 0. |
kind |
enum | point |
A point light fades to nothing at range; a directional one lights the whole view; a spot throws a cone the node's rotation aims, down at rest One of point, directional, spot. |
outer_angle_degrees |
float | 35 |
Half-angle a spot light fades to nothing at, in degrees Range 0–179. |
range |
float | 6 |
How far a point light reaches, in world units At least 0. |
shadow_enabled |
bool | true |
Whether occluder2d outlines cast shadows from this light |
source_radius |
float | 0.25 |
The disc a camera's gi pass emits a point or spot light from, in world units; gi gives a spot no cone and a directional light no form At least 0. |