UFO-Scripts/icons.ufo/2.3
The file base/ufos/icons.ufo
contains all icon definitions. An icon identify a named sprite displayed into some nodes, like buttons, tab, abstractoption... An icon have a size and is displayed according to a status coming from the "parent" node (normal, selected (hovered), disabled, click (no used)). The description define how the icon will be displayed according to this status.
Common information is the the image source of the sprite, the left-top corner, and the size of the sprite.
One sprite per status (default)
All sprites is computed according to the image, the corner, and the size. Normal status will use texl, selected status will use texl + 64, disabled status will use texl + 128, and click status will use texl + 192. Then we can pack icons into a texture of 256x256 where texl.y + size.y must be < 64.
icon skull_1 { image "ui/icon_pack2" texl "80 1" size "29 25" }
One sprite for all status
All status will use the same icon. Then there is no constraint on the texture size or on the properties.
icon skull_2 { image "ui/icon_pack2" texl "80 1" size "29 25" single true // activate the blend mode }
One blended sprite for all status
An only one sprite can be blended with a color. We can define one color per status.
There is no constraint on the texture size or on the properties, but sprite pixels should use pure black/white level with alpha. A pure white color will be translated to the exact requested color, and a pure black will be translated to black.
This icon will display a red skull when the icon is normal, a selected green skull, and a disabled blue skull.
icon skull_3 { image "ui/icon_pack2" texl "80 1" size "29 25" blend true // activate the blend mode normalcolor "1 0 0 1" selectedcolor "0 1 0 1" disabledcolor "0 0 1 1" }