Page 1 of 1
How change/get non-standard background color for icon
Posted: Sun Sep 23, 2018 12:48 pm
by hreintke
Hi,
I'd like to create recipe icons which have a different background than the default grey.
When I use the tint option, the icon itself get updated color.
Searching I found the color option but that seems not to have effect.
Code: Select all
icons = {
{
icon = "__base__/graphics/icons/fluid/crude-oil.png",
icon_size = 32,
tint = {b = 0,g = 0,r = 1,a = 0.1},
color = {b = 1,g = 0, r = 1}
}
},
Does anyone have a working example or a link to correct documentation ?
Re: How change/get non-standard background color for icon
Posted: Sun Sep 23, 2018 12:54 pm
by Klonan
hreintke wrote: Sun Sep 23, 2018 12:48 pm
Hi,
I'd like to create recipe icons which have a different background than the default grey.
When I use the tint option, the icon itself get updated color.
Searching I found the color option but that seems not to have effect.
Code: Select all
icons = {
{
icon = "__base__/graphics/icons/fluid/crude-oil.png",
icon_size = 32,
tint = {b = 0,g = 0,r = 1,a = 0.1},
color = {b = 1,g = 0, r = 1}
}
},
Does anyone have a working example or a link to correct documentation ?
The background color is dictated by the GUI they are in, in the recipe icon itself, the background is transparent.
Re: How change/get non-standard background color for icon
Posted: Mon Sep 24, 2018 10:17 am
by hreintke
OK, clear.
Thanks for the info.
Re: How change/get non-standard background color for icon
Posted: Tue Sep 25, 2018 7:32 pm
by darkfrei
Klonan wrote: Sun Sep 23, 2018 12:54 pm
The background color is dictated by the GUI they are in, in the recipe icon itself, the background is transparent.
Why I need icon_size in the item.icon_size, when I haven't icon, but icons?
For example it doesn't work:
Code: Select all
item.icons[1].icon = "__base__/graphics/icons/fluid/barreling/empty-barrel.png"
item.icons[1].icon_size = 32
item.icons[2].icon = "__base__/graphics/icons/fluid/barreling/barrel-side-mask.png"
item.icons[2].icon_size = 32
But this works:
Code: Select all
item.icon_size = 32
item.icons[1].icon = "__base__/graphics/icons/fluid/barreling/empty-barrel.png"
item.icons[2].icon = "__base__/graphics/icons/fluid/barreling/barrel-side-mask.png"
Why icon_size has no deal with icons?
Re: How change/get non-standard background color for icon
Posted: Wed Sep 26, 2018 8:08 am
by eradicator
darkfrei wrote: Tue Sep 25, 2018 7:32 pm
Why icon_size has no deal with icons?
Because the engine doesn't support icon layers with different sizes?