light
objects created in scripts are internally represented by the Light
class from the Stipple Effect source code.
For an arbitrary light
object named L
, functions of the form L.func_name(parameters) -> return_type
are value-returning functions, while functions of the form L.func_name(parameters);
are void functions, which perform an action but return nothing.
L.is_point() -> bool
Returns true
if L
is a point light, false
if L
is a directional light.
L.get_luminosity() -> float
Returns the luminosity of L
.
L.set_luminosity(float luminosity);
Sets the luminosity of L
to luminosity
.
L.get_color() -> color
Returns the base color of L
.
L.set_color(color c);
Sets the base color of L
to c
.
L.get_radius() -> float
Returns the radius of a point light L
.
Throws a runtime error if !L.is_point()
L.set_radius(float radius);
Sets the radius of a point light L
to radius
.
Fails if !L.is_point()
L.get_z() -> float
Returns the relative Z-axis position of a point light L
.
Throws a runtime error if !L.is_point()
L.set_z(float z);
Sets the relative Z-axis position of a point light L
to z
.
Fails if !L.is_point()
L.get_position() -> int[]
Returns the pixel source position of a point light L
.
Throws a runtime error if !L.is_point()
L.set_position(int[] position);
Sets the pixel source position of a point light L
to position
.
Fails if !L.is_point()
L.get_direction() -> float[]
Returns the direction of a directional light L
.
Throws a runtime error if L.is_point()
L.set_direction(float[] direction);
Sets the direction of a directional light L
to the 3-dimensional vector direction
.
Fails if L.is_point()