light

< API

light’s correspondent type in the Stippe Effect source code is Light.


Functions

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.

is_point

L.is_point() -> bool

Returns true if L is a point light, false if L is a directional light.

get_luminosity

L.get_luminosity() -> float

Returns the luminosity of L.

set_luminosity

L.set_luminosity(float luminosity);

Sets the luminosity of L to luminosity.

get_color

L.get_color() -> color

Returns the base color of L.

set_color

L.set_color(color c);

Sets the base color of L to c.

get_radius

L.get_radius() -> float

Returns the radius of a point light L.

Throws a runtime error if !L.is_point()

set_radius

L.set_radius(float radius);

Sets the radius of a point light L to radius.

Fails if !L.is_point()

get_z

L.get_z() -> float

Returns the relative Z-axis position of a point light L.

Throws a runtime error if !L.is_point()

set_z

L.set_z(float z);

Sets the relative Z-axis position of a point light L to z.

Fails if !L.is_point()

get_position

L.get_position() -> int[]

Returns the pixel source position of a point light L.

Throws a runtime error if !L.is_point()

set_position

L.set_position(int[] position);

Sets the pixel source position of a point light L to position.

Fails if !L.is_point()

get_direction

L.get_direction() -> float[]

Returns the direction of a directional light L.

Throws a runtime error if L.is_point()

set_direction

L.set_direction(float[] direction);

Sets the direction of a directional light L to the 3-dimensional vector direction.

Fails if L.is_point()