Factorio Prototype DocsVersion 1.1.107

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

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 :: bool
shift optional :: Vector
color optional :: Color

Color of the light.

Color of the light.

minimum_darkness optional :: float

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 :: bool optional

Default: false

shift :: Vector optional

color :: Color optional

Default: Light has no color

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

Prototypes

Types