One layer of an icon. Icon layering follows the following rules:
draw_background explicitly set to true. There are caveats to this though. See the doc.floating ones) fit the target slot, but won't be resized when displayed on machines in alt-mode. For example: recipe first icon layer is size 128, scale 1, the icon group will be displayed at resolution /4 to fit the 32px GUI boxes, but will be displayed 4 times as large on buildings.expected_icon_size / 2.The game automatically generates icon mipmaps for all icons. However, icons can have custom mipmaps defined. Custom mipmaps may help to achieve clearer icons at reduced size (e.g. when zooming out) than auto-generated mipmaps. If an icon file contains mipmaps then the game will automatically infer the icon's mipmap count. Icon files for custom mipmaps must contain half-size images with a geometric-ratio, for each mipmap level. Each next level is aligned to the upper-left corner, with no extra padding. Example sequence: 128x128@(0,0), 64x64@(128,0), 32x32@(192,0) is three mipmaps.
struct
FileNamefalsePath to the icon file.
SpriteSizeTypetrueThe size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.
ColortrueThe tint to apply to the icon.
VectortrueUsed to offset the icon "layer" from the overall icon. The shift is applied from the center (so negative shifts are left and up, respectively). Shift values are "in pixels" where the overall icon is assumed to be expected_icon_size / 2 pixels in width and height, meaning shift {0, expected_icon_size/2} will shift it by entire icon height down.
doubletrueDefaults to (expected_icon_size / 2) / icon_size.
Specifies the scale of the icon on the GUI scale. A scale of 2 means that the icon will be two times bigger on screen (and thus more pixelated).
Expected icon sizes:
512 for SpaceLocationPrototype::starmap_icon.256 for TechnologyPrototype.128 for AchievementPrototype and ItemGroup.32 for ShortcutPrototype::icons and 24 for ShortcutPrototype::small_icons.64 for the rest of the prototypes that use icons.booleantrueOutline is drawn using signed distance field generated on load. One icon image will have only one SDF generated. That means if the image is used in multiple icons with different scales, the outline width won't match the desired width in all the scales except the largest one.
booleantrueWhen true the layer is not considered for calculating bounds of the icon, so it can go out of bounds of rectangle into which the icon is drawn in GUI.