SetLightSpecular

Definition

SetLightSpecular(string lightObjectName, float red, float green, float blue)

Description

This function sets the specular color of light lightObjectName as three values of red, green and blue. Each value ranges from 0.0 to 1.0.

Parameters

lightObjectName
Specifies the name of the light object. You can also use the name “this” for this parameter. In this case, “this” refers to the light object name to which this script is attached.

red, green, blue
Specify the specular color of light lightObjectName as three values of red, green and blue. Each value ranges from 0.0 to 1.0.

Example 1

function Init()
    SetLightSpecular("light1", 0.25, 0.5, 0.75)
end

function Update()

end
In this example, the SetLightSpecular function sets the value of the red, green, and blue components of the specular color of light “light1” to 0.250.5 and 0.75, respectively.

Example 2

--Script name is SetLightSpecular2.lua

function Init()
    SetLightSpecular("this", 0.25, 0.5, 0.75)
end

function Update()

end
Assume that the above script named SetLightSpecular2.lua is attached to the light object named “light1”. In this case, string “this”  in the SetLightSpecular function will be equal to “light1”. In our example, the function SetLightSpecular sets the values of red, green and blue components of specular color of current light, which is “light1”, to 0.250.5 and 0.75, respectively.
adminSetLightSpecular