Types/LightDefinition: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (fixed link)
(1.0.0: added source_orientation_offset)
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:


* picture - [[Types/Sprite]], mandatory
* picture - [[Types/Sprite]], mandatory
* rotation_shift - [[Types/float]], optional
* rotation_shift - [[Types/RealOrientation]], optional


=== intensity ===
=== intensity ===
Line 27: Line 27:
== Optional properties ==
== Optional properties ==


=== color ===
=== source_orientation_offset ===
'''Type''': [[Types/Color]]
'''Type''': [[Types/RealOrientation]]


'''Default''': Light has no color
'''Default''': 0
 
Color of the light.


=== add_perspective ===
=== add_perspective ===
Line 41: Line 39:
=== shift ===
=== shift ===
'''Type''': [[Types/vector]]
'''Type''': [[Types/vector]]
=== color ===
'''Type''': [[Types/Color]]
'''Default''': Light has no color
Color of the light.


=== minimum_darkness ===
=== minimum_darkness ===
Line 50: Line 55:
The light of the orange state of the rail signal.
The light of the orange state of the rail signal.
<syntaxhighlight lang="lua">orange_light = {intensity = 0.2, size = 4, color={r=1, g=0.5}}</syntaxhighlight>
<syntaxhighlight lang="lua">orange_light = {intensity = 0.2, size = 4, color={r=1, g=0.5}}</syntaxhighlight>
{{Prototype property type usage|{{FULLPAGENAME}}}}

Revision as of 11:32, 8 September 2020

Basics

Specifies the light source

Mandatory properties

type

Type: Types/string

Default: "basic"

Either "basic" or "oriented". If the type is "oriented", the following properties are read additionally to the other properties:

intensity

Type: Types/float

Brightness of the light in the range [0, 1] where 0 is no light and 1 is the maximum light.

intensity = 0.5

size

Type: Types/float

The radius of the light in tiles. Note, that the light gets darker near the edges, so the effective size of the light seems to be smaller.

size = 15 -- big light source

Optional properties

source_orientation_offset

Type: Types/RealOrientation

Default: 0

add_perspective

Type: Types/bool

Default: false

shift

Type: Types/vector

color

Type: Types/Color

Default: Light has no color

Color of the light.

minimum_darkness

Type: Types/float

Default: 0

Example

The light of the orange state of the rail signal.

orange_light = {intensity = 0.2, size = 4, color={r=1, g=0.5}}

Prototype properties that use this type