Light
Light controls an authored directional Light component. RGB channels are
8-bit values. The editor preview and PS1 renderer consume the same authored
state through different rendering paths, so validate the final result in the
release CUE.
| Method | Returns | Description |
|---|---|---|
Light.Has(gameObjectId) | boolean | Checks for a Light component. |
Light.GetDirection(gameObjectId) | Vec3 or nil | Reads direction. |
Light.SetDirection(gameObjectId, x, y, z) | boolean | Sets direction; runtime normalizes it. |
Light.GetColor(gameObjectId) | RGB table or nil | Reads directional color. |
Light.SetColor(gameObjectId, r, g, b) | boolean | Sets directional color. |
Light.GetIntensity(gameObjectId) | number or nil | Reads intensity. |
Light.SetIntensity(gameObjectId, intensity) | boolean | Sets validated intensity. |
Light.GetAmbient(gameObjectId) | RGB table or nil | Reads ambient color. |
Light.SetAmbient(gameObjectId, r, g, b) | boolean | Sets ambient color. |
lightGameObjectId = -1
function WarmLighting(gameObjectId)
if Light.Has(lightGameObjectId) then
Light.SetColor(lightGameObjectId, 255, 208, 160)
Light.SetAmbient(lightGameObjectId, 48, 36, 32)
Light.SetIntensity(lightGameObjectId, 1.25)
end
end