Trigger API Reference\DCEI Functions\Lighting
void SetCustomLightColor(string name, ColorRGB color, float duration)
void SetCustomLightColor(string name, ColorRGB color, float duration)
Description
Change a custom light's color gradually over duration time.
To create a custom light, go to Terrain Window > Lights
Parameters
- string
name
the name of the light. - ColorRGB
color
the RGB values for the line. Also accepts hex values such as"#32a852"
- float
duration
the duration of this change.
Example Usage
local name = "fire_light"
local color = { r = 0.5, g = 0.5, b = 0, a = 0.5 }
local duration = 3
DCEI.SetCustomLightColor(name, color, duration)
void SetCustomLightIntensity(string name, float intensity, float duration)
void SetCustomLightIntensity(string name, float intensity, float duration)
Description
Change a custom light's intensity gradually over duration time.
Parameters
- string
name
the name of the light. - float
intensity
thew new intensity of the light. - float
duration
the duration of this change.
Example Usage
local name = "fire_light"
local intensity = 0.1
local duration = 3
DCEI.SetCustomLightIntensity(name, intensity, duration)
void SetCustomLightPosition(string name, Float3 position, float duration)
void SetCustomLightPosition(string name, Float3 position, float duration)
Description
Change a custom light's position gradually over duration time.
Parameters
- string
name
the name of the light. - Float3
position
the position of the light. - float
duration
the duration of this change.
Example Usage
local name = "fire_light"
local pos = { x = 10, y = 1, z = 15 }
local duration = 3
DCEI.SetCustomLightPosition(name, pos, duration)
ColorRGB GetCustomLightColor(string name)
ColorRGB GetCustomLightColor(string name)
Description
Get the current RGB value of the light.
Parameters
- string
name
the name of the light.
Example Usage
local light_color = DCEI.GetCustomLightColor("fire_light")
DCEI.LogMessage("R: " .. light_color.r)
DCEI.LogMessage("G: " .. light_color.g)
DCEI.LogMessage("B: " .. light_color.b)