Types/IconData

From Official Factorio Wiki
Revision as of 16:24, 3 August 2021 by Honktown (talk | contribs) (→‎tint)
Jump to navigation Jump to search

Basics

Data of one icon "layer" for the icons property of the Types/IconSpecification.

Mandatory properties

icon

Type: Types/FileName

The path to the icon.

icon_size

Type: Types/SpriteSizeType

Mandatory if icon_size is not specified outside of icons. The size of the square icon, in pixels, e.g. 32 for a 32px by 32px icon.

Optional properties

tint

Type: Types/Color

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

Tint of the icon. Default is when tint = nil. See Type for full details.

shift

Type: Types/vector

Default: {0, 0}

Used to offset the icon "layer" from the overall icon.

scale

Type: Types/double

Default: 1

Values different than 1 specify the scale of the icon on default gui scale. Scale 2 means that the icon will be 2 times bigger on screen (and more pixelated).

icon_mipmaps

Type: Types/uint8

Default: 0

Examples

{
  icon = "__base__/graphics/icons/fluid/heavy-oil.png",
  icon_size = 32,
  scale = 0.5,
  shift = {4, -8}
}