Light types: Point=0, Sun=1, Spot=2, Hemi=3, Area=4. Attach to a Node via setNode(node) so the light’s position/direction follows the node.
Returns: Light — A new light. Attach to a node and set a tag so Scene.findLightByTag can find it.
| Method / property | Returns / Parameters | Description |
|---|
getTag() | String | Tag for findLightByTag |
setTag(tag) | — | tag (String) — Set the tag |
node | Node or null | Node this light is attached to |
setNode(node) | — | node (Node) — Attach light to this node |
| Property | Type | Description |
|---|
type / type=(t) | Num (0–4) | Light type: Point=0, Sun=1, Spot=2, Hemi=3, Area=4 |
r / g / b | Num (0–1) | Red, green, blue (linear RGB) |
setColor(r, g, b) | — | r, g, b (Num) — Set color (0–1) |
energy / energy=(e) | Num | Intensity/energy of the light |
var light = _scene.addLight()
light.setTag("main_light")
var lightNode = _scene.addNode("LightNode")
lightNode.setPosition(4, 4, 4)
| Property | Type | Description |
|---|
radius / radius=(r) | Num | Radius for soft shadows |
spotAngle / spotAngle=(a) | Num | Spot light cone angle (radians) |
spotBlend / spotBlend=(b) | Num | Spot edge softness (0–1) |
areaWidth / areaHeight | Num | Area light width/height |
setAreaSize(w, h) | — | w, h (Num) — Set area size |