SetLightRange

Category: Objects
Since engine version: 6.0 OC

Description

Sets the light reach of the object. When a clonk is added to the crew via MakeCrewMember, a light is added automatically with the default range of 300 and a fadeout of 80.

Syntax

void SetLightRange(int range, int fadeout);

Parameters

range:
Light reach in pixels. In this range, the light has 100% intensity.
fadeout:
[opt] Light fadeout reach in pixels. Default is 80. If the range is set to 0 and this parameter is not defined, the fadeout will also be 0.

Remark

A local offset for the light center can be defined by setting the object property LightOffset to an array with two elements for X- and Y-offset respectively.

Examples

func ControlUse(object clonk)
{
	clonk->SetLightRange(0);
	Sound("Scream");
	return true;
}
Confused the acid phile with the eye drops, did ya?
func Construction()
{
	SetLightRange(100, 100);
	this.LightOffset = [0,-100];
	return true;
}
Script for a lamp post. A light coming from 100 pixel above the object center is enabled when the object is created.
See also: SetFoW, SetLightColor, SetPlrView