Page 1 of 1
icon overlaying/Algorithmic overlay creation
Posted: Tue May 22, 2018 8:35 pm
by ukezi
I'm making a mod with a few Items with a big configurable number of tiers. For that I would like to have Icons with the corresponding number on it, for instance in the left lower corner. Can I create that overly algorithmic in any way? The game does that kind of automatic for the infinity research. But that seams not to be exposed to the moder.
Re: icon overlaying/Algorithmic overlay creation
Posted: Tue May 22, 2018 8:47 pm
by darkfrei
ukezi wrote:I'm making a mod with a few Items with a big configurable number of tiers. For that I would like to have Icons with the corresponding number on it, for instance in the left lower corner. Can I create that overly algorithmic in any way? The game does that kind of automatic for the infinity research. But that seams not to be exposed to the moder.
1. Make 10 icons with digits 0-9;
2. Add to prototype icons instead of icon (see Factorio_0.16\data\base\data-updates.lua):
Code: Select all
icons = {
{
icon = "__base__/graphics/icons/fluid/barreling/barrel-fill.png"
},
{
icon = barrel_fill_side_mask,
tint = side_tint
},
{
icon = barrel_fill_top_mask,
tint = top_hoop_tint
},
{
icon = fluid.icon,
scale = 0.5,
shift = {4, -8}
}
}
or in another view it looks like
Code: Select all
data.raw.recipe["fill-water-barrel"].icons[1].icon = "__base__/graphics/icons/fluid/barreling/barrel-fill.png"
data.raw.recipe["fill-water-barrel"].icons[2].icon = "__base__/graphics/icons/fluid/barreling/barrel-fill-side-mask.png"
data.raw.recipe["fill-water-barrel"].icons[2].tint.r = 0
data.raw.recipe["fill-water-barrel"].icons[2].tint.g = 0.34
data.raw.recipe["fill-water-barrel"].icons[2].tint.b = 0.6
data.raw.recipe["fill-water-barrel"].icons[2].tint.a = 0.75
data.raw.recipe["fill-water-barrel"].icons[3].icon = "__base__/graphics/icons/fluid/barreling/barrel-fill-top-mask.png"
data.raw.recipe["fill-water-barrel"].icons[3].tint.r = 0.7
data.raw.recipe["fill-water-barrel"].icons[3].tint.g = 0.7
data.raw.recipe["fill-water-barrel"].icons[3].tint.b = 0.7
data.raw.recipe["fill-water-barrel"].icons[3].tint.a = 0.75
data.raw.recipe["fill-water-barrel"].icons[4].icon = "__base__/graphics/icons/fluid/water.png"
data.raw.recipe["fill-water-barrel"].icons[4].scale = 0.5
data.raw.recipe["fill-water-barrel"].icons[4].shift[1] = 4
data.raw.recipe["fill-water-barrel"].icons[4].shift[2] = -8
Just scale and shift to the right position. One layer - one icon.