Skip to main content

light2d

2d · render · 5 properties · 2D

A 2D light: the node's position places it, its rotation aims a directional one, and everything drawn under it — sprites, polygons, tiles, a 3D scene behind them — is multiplied by the light map the scene's lights build. A scene with no light2d draws exactly as it does unlit; the first one added makes everything else fall to the camera's ambient. Debug lines and particles draw after the light map and stay unlit.

In a scene, light2d is the node key that applies it. A script reaches the same properties through node.light2d.get() and node.light2d.set(table).

Properties

propertytypedefaultdescription
colorcolor[1,1,1,1]Light colour, as channel floats or #rrggbb / #rrggbbaa
intensityfloat1Brightness multiplier; over 1 blows past white At least 0.
kindenumpointA point light fades to nothing at radius; a directional one lights the whole view One of point, directional.
radiusfloat6How far a point light reaches, in world units At least 0.
shadowsbooltrueWhether occluder2d outlines cast shadows from this light