• Reference
  • LUA API
  • Classes
  • Light

Light

Light Play Light is a tool that simulates real-world optical properties and can add realism and beauty to a game scene.

Functions

get_light_by_scene_id

Get the Light according to the scene ID.

Parameter

VariableTypeDescription
scene_idnumberID in the edit scene.

Return

TypeDescription
LightLight ID.
cli.get_light_by_scene_id(scene_id)

get_light_attribute

Get the light attribute.

Parameter

VariableTypeDescription
keystringName of the attribute.

Return

TypeDescription
numberValue of the attribute.
light:get_light_attribute(key)

get_light_cast_shadow_state

Get whether the light casts a shadow.

Return

TypeDescription
booleanWhether to cast a shadow or not.
light:get_light_cast_shadow_state()

create_point_light_at_point

Create a point light to a point.

Parameters

VariableTypeDescription
pointpointTarget point.
deviation_heightnumberOffset height.

Return

TypeDescription
LightLight ID.
light.create_point_light_at_point(point, deviation_height)

create_point_light_at_unit_socket

Create a point light to a unit socket.

Parameters

VariableTypeDescription
unitunitTarget unit.
socket_namestringHookup point.
deviation_heightnumberOffset height.
light.create_point_light_at_unit_socket(unit, socket_name, deviation_height)

create_directional_light_at_point

Create directional light to point.

Parameters

VariableTypeDescription
pointpointTarget point.
deviation_heightnumberOffset height.
unit_point_projectilepointTarget point.
target_deviation_heightnumberTarget point offset height.
light.create_directional_light_at_point(point, deviation_height, unit_point_projectile, target_deviation_height)

create_directional_light_at_unit_socket

Create a directional Light to a unit mount point.

Parameters

VariableTypeDescription
unitunitTarget unit.
socket_namestringHookup point.
deviation_heightnumberOffset height.
target_unitunitTarget unit.
target_deviation_heightnumberTarget point offset height.
light.create_directional_light_at_unit_socket(unit, socket_name, deviation_height, target_unit, target_deviation_height)

remove_light

Remove light.

light:remove_light()

set_shadow_casting_status

Set whether the light casts shadows.

Parameter

VariableTypeDescription
is_cast_shadowbooleanWhether to cast shadows.
light:set_shadow_casting_status(is_cast_shadow)

set_point_light_attribute

Set the point light attribute.

Parameters

VariableTypeDescription
light_attr_type_namestringAttribute name.
valuenumberValue of the attribute.
light:set_point_light_attribute(light_attr_type_name, value)

set_directional_light_attribute

Set the directional light attribute.

Parameters

VariableTypeDescription
light_attr_type_namestringAttribute name.
valuenumberValue of the attribute.
light:set_directional_light_attribute(light_attr_type_name, value)