Home

IconData

One layer of an icon. Icon layering follows the following rules:

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.

Type

struct

Properties

icon

Path to the icon file.

icon_size

The size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.

tint

The tint to apply to the icon.

shift

Used 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.

scale

Defaults 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:

draw_background

Outline 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.

floating

When 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.