LightDefinition :: struct or array[struct] Example code
| type optional | :: "basic" or "oriented" | |
| picture optional | :: Sprite | Only loaded, and mandatory if |
Only loaded, and mandatory if | ||
| rotation_shift optional | :: RealOrientation | Only loaded if |
Only loaded if | ||
| intensity | :: float | Brightness of the light in the range |
Brightness of the light in the range | ||
| size | :: float | The radius of the light in tiles. [...] |
The radius of the light in tiles. [...] | ||
| source_orientation_offset optional | :: RealOrientation | |
| add_perspective optional | :: boolean | |
| flicker_interval optional | :: uint8 | |
| flicker_min_modifier optional | :: float | |
| flicker_max_modifier optional | :: float | |
| offset_flicker optional | :: boolean | Offsets tick used to calculate flicker by position hash. [...] |
Offsets tick used to calculate flicker by position hash. [...] | ||
| shift optional | :: Vector | |
| color optional | :: Color | Color of the light. |
Color of the light. | ||
| minimum_darkness optional | :: float | |
Properties
picture :: Sprite optional 
rotation_shift :: RealOrientation optional 
intensity :: float
size :: float
source_orientation_offset :: RealOrientation optional 
add_perspective :: boolean optional 
flicker_interval :: uint8 optional 
flicker_min_modifier :: float optional 
flicker_max_modifier :: float optional 
offset_flicker :: boolean optional 
shift :: Vector optional 
color :: Color optional 
minimum_darkness :: float optional 
Examples 
-- 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}
}
}
Type used in
- BeaconGraphicsSet::light
- CarPrototype::light
- CharacterPrototype::light
- ChargableGraphics::charge_light
- ChargableGraphics::discharge_light
- CircuitConnectorSprites::led_light
- CombatRobotPrototype::light
- CombinatorPrototype::activity_led_light
- CombinatorPrototype::screen_light
- ConstantCombinatorPrototype::activity_led_light
- ConstructionRobotPrototype::working_light
- ElectricEnergyInterfacePrototype::light
- ElectricPolePrototype::light
- ExplosionPrototype::light
- FireFlamePrototype::light
- FluidStreamPrototype::stream_light
- FluidStreamPrototype::ground_light
- FluidTurretPrototype::muzzle_light
- FluidTurretPrototype::enough_fuel_indicator_light
- FluidTurretPrototype::not_enough_fuel_indicator_light
- FusionGeneratorGraphicsSet::light
- FusionReactorGraphicsSet::light
- LabPrototype::light
- LampPrototype::light
- LampPrototype::light_when_colored
- LightningGraphicsSet::light
- LocomotivePrototype::front_light
- ProjectilePrototype::light
- RailSignalLightDefinition::light
- ReactorPrototype::light
- RoboportEquipmentPrototype::recharging_light
- RoboportPrototype::recharging_light
- RocketSiloPrototype::base_light
- RocketSiloPrototype::base_engine_light
- RocketSiloRocketPrototype::glow_light
- RollingStockPrototype::back_light
- RollingStockPrototype::stand_by_light
- SpiderVehicleGraphicsSet::light
- SpiderVehicleGraphicsSet::eye_light
- StatelessVisualisation::light
- TrainStopLight::light
- UnitPrototype::light
- WallPrototype::wall_diode_green_light_top
- WallPrototype::wall_diode_green_light_right
- WallPrototype::wall_diode_green_light_bottom
- WallPrototype::wall_diode_green_light_left
- WallPrototype::wall_diode_red_light_top
- WallPrototype::wall_diode_red_light_right
- WallPrototype::wall_diode_red_light_bottom
- WallPrototype::wall_diode_red_light_left
- WorkingVisualisation::light

