Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# LightDefinition - Prototype Docs

## LightDefinition :: struct or array[struct] Example code

Specifies a light source. This is loaded either as a single light source or as an array of light sources.

## Properties

- default
- sorted

type optional | :: `"basic"` or `"oriented"` |
picture optional | :: Sprite | Only loaded, and mandatory if `type` is `"oriented"`.
Only loaded, and mandatory if `type` is `"oriented"`.
rotation_shift optional | :: RealOrientation | Only loaded if `type` is `"oriented"`.
Only loaded if `type` is `"oriented"`.
intensity | :: float | Brightness of the light in the range `[0, 1]`, where `0` is no light and `1` is the maximum light.
Brightness of the light in the range `[0, 1]`, where `0` is no light and `1` is the maximum light.
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 |

intensity | :: float | Brightness of the light in the range `[0, 1]`, where `0` is no light and `1` is the maximum light.
Brightness of the light in the range `[0, 1]`, where `0` is no light and `1` is the maximum light.
size | :: float | The radius of the light in tiles. [...]
The radius of the light in tiles. [...]
add_perspective optional | :: boolean |
color optional | :: Color | Color of the light.
Color of the light.
flicker_interval optional | :: uint8 |
flicker_max_modifier optional | :: float |
flicker_min_modifier optional | :: float |
minimum_darkness optional | :: float |
offset_flicker optional | :: boolean | Offsets tick used to calculate flicker by position hash. [...]
Offsets tick used to calculate flicker by position hash. [...]
picture optional | :: Sprite | Only loaded, and mandatory if `type` is `"oriented"`.
Only loaded, and mandatory if `type` is `"oriented"`.
rotation_shift optional | :: RealOrientation | Only loaded if `type` is `"oriented"`.
Only loaded if `type` is `"oriented"`.
shift optional | :: Vector |
source_orientation_offset optional | :: RealOrientation |
type optional | :: `"basic"` or `"oriented"` |

## Properties

### type :: `"basic"` or `"oriented"` optional

Default: `"basic"`

### picture :: Sprite optional

Only loaded, and mandatory if `type` is `"oriented"`.

### rotation_shift :: RealOrientation optional

Default: `0`

Only loaded if `type` is `"oriented"`.

### intensity :: float

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

### size :: float

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

### source_orientation_offset :: RealOrientation optional

Default: `0`

### add_perspective :: boolean optional

Default: `false`

### flicker_interval :: uint8 optional

Default: `0`

### flicker_min_modifier :: float optional

Default: `1.0`

### flicker_max_modifier :: float optional

Default: Value of `flicker_min_modifier`

### offset_flicker :: boolean optional

Default: `false`

Offsets tick used to calculate flicker by position hash. Useful to desynchronize flickering of multiple stationary lights.

### shift :: Vector optional

### color :: Color optional

Default: `{r=1, g=1, b=1}`

Color of the light.

### minimum_darkness :: float optional

Default: `0`

## 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