Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SLight Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SLight:
ScriptClassComponent< Light >

Properties

bool Enabled [get, set]
 Enable/Disable this light. More...
 
float Range [get, set]
 Get/Set the effective range of the light source. More...
 
float SpotAngle [get, set]
 Define the angle at the basement of a spot light’s cone. More...
 
float Intensity [get, set]
 Get/Set the intensity of the light source. (Multiplied with the light color) More...
 
SVector Color [get, set]
 Get/Set the color of the light. More...
 
SLightType Type [get, set]
 Get/Set the type of light this source is. 0 = Directional, 1 = Point, 2 = Spot, 3 = Area. More...
 
- Properties inherited from ScriptClassComponent< Light >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Property Documentation

◆ Color

SVector SineSpace.Scripting.Components.SLight.Color
getset

Get/Set the color of the light.

local obj = Space.Host.ExecutingObject;
obj.AddLight()
Space.Log(obj.Light.Color);
&ndash; prints "[1,1,1]" (white) to the console.
local newColor = Vector.New(0.5,0.5,0); &ndash; yellow color
obj.Light.Color = newColor;
&ndash; Now the color of the light is yellow.

◆ Enabled

bool SineSpace.Scripting.Components.SLight.Enabled
getset

Enable/Disable this light.

Space.Host.ExecutingObject.AddLight();
Space.Host.ExecutingObject.Light.Enabled = false;
&ndash; Disable this object's Light Source.

◆ Intensity

float SineSpace.Scripting.Components.SLight.Intensity
getset

Get/Set the intensity of the light source. (Multiplied with the light color)

Space.Host.ExecutingObject.AddLight()
&ndash; Get the intensity of the Light &ndash;
Space.Log("Intensity: " ..Space.Host.ExecutingObject.Light.Intensity);

◆ Range

float SineSpace.Scripting.Components.SLight.Range
getset

Get/Set the effective range of the light source.

Space.Host.ExecutingObject.AddLight()
Space.Host.ExecutingObject.Light.Range = 8.0;
&ndash; Change the range of the Light.

◆ SpotAngle

float SineSpace.Scripting.Components.SLight.SpotAngle
getset

Define the angle at the basement of a spot light’s cone.

light=Space.Host.ExecutingObject.AddLight()
&ndash;add and get light component to runtime object
light.Type=2
&ndash;set light type
light.SpotAngle=60
&ndash;set spot angle to 60

◆ Type

SLightType SineSpace.Scripting.Components.SLight.Type
getset

Get/Set the type of light this source is. 0 = Directional, 1 = Point, 2 = Spot, 3 = Area.

local obj = Space.Host.ExecutingObject;
obj.AddLight()
Space.Log(obj.Light.Type);
&ndash; prints "1" (default) to the console.
obj.Light.Type = 0;
&ndash; Now the light type has changed to Directional.