Structures/DynamicLight

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(NOTE: Renamed members do not mean anything. The members are case insensitive.)
Line 2: Line 2:
 
|Description=Structure for {{GlobalFunction|DynamicLight}}.<br/>
 
|Description=Structure for {{GlobalFunction|DynamicLight}}.<br/>
 
''Note! This is an actual class named '''dlight_t''', not a table.''
 
''Note! This is an actual class named '''dlight_t''', not a table.''
|Fields={{StructureField|number|Brightness|The brightness of the light}}{{StructureField|number|Decay|Fade out speed.
+
|Fields={{StructureField|number|brightness|The brightness of the light.}}{{StructureField|number|decay|Fade out speed.
 
Here's a formula for calculating Decay for your light: 1000 / fadeOutTimeInSeconds. For example setting decay to 1000 would fade out the light in 1 second, 2000 - 0.5 seconds.
 
Here's a formula for calculating Decay for your light: 1000 / fadeOutTimeInSeconds. For example setting decay to 1000 would fade out the light in 1 second, 2000 - 0.5 seconds.
}}{{StructureField|number|DieTime|Time after which light will be removed. This is relative to {{GlobalFunction|CurTime}}.
+
}}{{StructureField|number|dietime|Time after which light will be removed.
If you put in a value that is less than {{GlobalFunction|CurTime}}, the light will not behave properly.<br/>
+
 
 +
This is relative to {{GlobalFunction|CurTime}}. If you put in a value that is less than or equal to {{GlobalFunction|CurTime}}, the light will not behave properly.
 +
 
 
Note, that it does not affect fading out. Light will be removed regardless of it being fully faded out or not.
 
Note, that it does not affect fading out. Light will be removed regardless of it being fully faded out or not.
}}{{StructureField|Vector|Dir|The light direction}}{{StructureField|number|InnerAngle|Unknown}}{{StructureField|number|Key|Unknown}}{{StructureField|number|MinLight|Minimum light}}{{StructureField|boolean|NoWorld|Don't light the world}}{{StructureField|boolean|NoModel|Don't light models}}{{StructureField|number|OuterAngle|Unknown}}{{StructureField|Vector|Pos|Position of the light}}{{StructureField|number|Size|Radius of the light}}{{StructureField|number|Style|Flicker style see render FX}}{{StructureField|number|b|The blue part of the color}}{{StructureField|number|g|The green part of the color}}{{StructureField|number|r|The red part of the color}}
+
}}{{StructureField|Vector|dir|The light direction. Used with '''InnerAngle''' and '''OuterAngle'''.|Vector( 0, 0, 0 )}}{{StructureField|number|innerangle|The closer this is to zero, the smoother the light will be. Requires '''Dir''' and '''OuterAngle''' to be set.|0}}{{StructureField|number|outerangle|The angle of the Dynamic Light. Requires '''Dir''' to be set.|0}}{{StructureField|number|key|Makes the light brighter and flicker? Changing the value does not seem to affect anything.}}{{StructureField|number|minlight|Minimum light|0}}{{StructureField|boolean|noworld|Don't light the world|false}}{{StructureField|boolean|nomodel|Don't light models|false}}{{StructureField|Vector|pos|Position of the light}}{{StructureField|number|size|Radius of the light}}{{StructureField|number|style|Flicker style see render FX}}{{StructureField|number|b|The blue part of the color}}{{StructureField|number|g|The green part of the color}}{{StructureField|number|r|The red part of the color}}
 
}}
 
}}

Revision as of 16:30, 6 September 2014

Structure for DynamicLight.

Note! This is an actual class named dlight_t, not a table.

Type Name Description
number brightness

The brightness of the light.

number decay

Fade out speed. Here's a formula for calculating Decay for your light: 1000 / fadeOutTimeInSeconds. For example setting decay to 1000 would fade out the light in 1 second, 2000 - 0.5 seconds.

number dietime

Time after which light will be removed.

This is relative to CurTime. If you put in a value that is less than or equal to CurTime, the light will not behave properly.

Note, that it does not affect fading out. Light will be removed regardless of it being fully faded out or not.

Vector dir

The light direction. Used with InnerAngle and OuterAngle.

Default: Vector( 0, 0, 0 )

number innerangle

The closer this is to zero, the smoother the light will be. Requires Dir and OuterAngle to be set.

Default: 0

number outerangle

The angle of the Dynamic Light. Requires Dir to be set.

Default: 0

number key

Makes the light brighter and flicker? Changing the value does not seem to affect anything.

number minlight

Minimum light

Default: 0

boolean noworld

Don't light the world

Default: false

boolean nomodel

Don't light models

Default: false

Vector pos

Position of the light

number size

Radius of the light

number style

Flicker style see render FX

number b

The blue part of the color

number g

The green part of the color

number r

The red part of the color

Personal tools
Navigation