Types/LightDefinition: Difference between revisions
(0.16) |
(can be an array of LightDefinition) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== | Either a table with the properties listed below or an [[Types/table|array]] of tables with the below properties. Specifies a 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: | |||
* picture - [[Types/Sprite]], mandatory | |||
* rotation_shift - [[Types/RealOrientation]], optional | |||
=== intensity === | === intensity === | ||
'''Type''': [[Types/float]] | '''Type''': [[Types/float]] | ||
Line 14: | Line 23: | ||
Note, that the light gets darker near the edges, so the effective size of the light seems to be smaller. | Note, that the light gets darker near the edges, so the effective size of the light seems to be smaller. | ||
<syntaxhighlight lang="lua">size = 15 -- big light source</syntaxhighlight> | <syntaxhighlight lang="lua">size = 15 -- big light source</syntaxhighlight> | ||
''' | == Optional properties == | ||
=== source_orientation_offset === | |||
'''Type''': [[Types/RealOrientation]] | |||
'''Default''': 0 | |||
=== add_perspective === | === add_perspective === | ||
Line 28: | Line 38: | ||
=== 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 37: | Line 54: | ||
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> | ||
The front lights of the car: | |||
<syntaxhighlight lang="lua">light = | |||
{ | |||
{ | |||
type = "oriented", | |||
minimum_darkness = 0.3, | |||
picture = | |||
{ | |||
filename = "__core__/graphics/light-cone.png", | |||
priority = "extra-high", | |||
flags = { "light" }, | |||
scale = 2, | |||
width = 200, | |||
height = 200 | |||
}, | |||
shift = {-0.6, -14}, | |||
size = 2, | |||
intensity = 0.6, | |||
color = {r = 0.92, g = 0.77, b = 0.3} | |||
}, | |||
{ | |||
type = "oriented", | |||
minimum_darkness = 0.3, | |||
picture = | |||
{ | |||
filename = "__core__/graphics/light-cone.png", | |||
priority = "extra-high", | |||
flags = { "light" }, | |||
scale = 2, | |||
width = 200, | |||
height = 200 | |||
}, | |||
shift = {0.6, -14}, | |||
size = 2, | |||
intensity = 0.6, | |||
color = {r = 0.92, g = 0.77, b = 0.3} | |||
} | |||
}</syntaxhighlight> | |||
{{Prototype property type usage|{{FULLPAGENAME}}}} |
Latest revision as of 17:17, 24 March 2022
Either a table with the properties listed below or an array of tables with the below properties. Specifies a 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:
- picture - Types/Sprite, mandatory
- rotation_shift - Types/RealOrientation, optional
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}}
The front lights of the car:
light =
{
{
type = "oriented",
minimum_darkness = 0.3,
picture =
{
filename = "__core__/graphics/light-cone.png",
priority = "extra-high",
flags = { "light" },
scale = 2,
width = 200,
height = 200
},
shift = {-0.6, -14},
size = 2,
intensity = 0.6,
color = {r = 0.92, g = 0.77, b = 0.3}
},
{
type = "oriented",
minimum_darkness = 0.3,
picture =
{
filename = "__core__/graphics/light-cone.png",
priority = "extra-high",
flags = { "light" },
scale = 2,
width = 200,
height = 200
},
shift = {0.6, -14},
size = 2,
intensity = 0.6,
color = {r = 0.92, g = 0.77, b = 0.3}
}
}
Prototype properties that use this type
- Prototype/Accumulator : charge_light
- Prototype/Accumulator : discharge_light
- Prototype/Car : light
- Prototype/Character : light
- Prototype/CombatRobot : light
- Prototype/Combinator : activity_led_light
- Prototype/Combinator : screen_light
- Prototype/ConstantCombinator : activity_led_light
- Prototype/ConstructionRobot : working_light
- Prototype/ElectricEnergyInterface : light
- Prototype/ElectricPole : light
- Prototype/Explosion : light
- Prototype/FireFlame : light
- Prototype/FluidStream : ground_light
- Prototype/FluidStream : stream_light
- Prototype/FluidTurret : enough_fuel_indicator_light
- Prototype/FluidTurret : muzzle_light
- Prototype/FluidTurret : not_enough_fuel_indicator_light
- Prototype/Lab : light
- Prototype/Lamp : light
- Prototype/Lamp : light_when_colored
- Prototype/Locomotive : front_light
- Prototype/Projectile : light
- Prototype/RailChainSignal : blue_light
- Prototype/RailSignalBase : green_light
- Prototype/RailSignalBase : orange_light
- Prototype/RailSignalBase : red_light
- Prototype/Reactor : light
- Prototype/Roboport : recharging_light
- Prototype/RoboportEquipment : recharging_light
- Prototype/RocketSilo : base_engine_light
- Prototype/RocketSilo : base_light
- Prototype/RocketSiloRocket : glow_light
- Prototype/RollingStock : back_light
- Prototype/RollingStock : stand_by_light
- Prototype/Unit : light
- Prototype/Wall : wall_diode_green_light_bottom
- Prototype/Wall : wall_diode_green_light_left
- Prototype/Wall : wall_diode_green_light_right
- Prototype/Wall : wall_diode_green_light_top
- Prototype/Wall : wall_diode_red_light_bottom
- Prototype/Wall : wall_diode_red_light_left
- Prototype/Wall : wall_diode_red_light_right
- Prototype/Wall : wall_diode_red_light_top