I am dynamically creating items in my mod.
As far as I know I need to default for generic icons (e.g. those already in base).
Is there any way to dynamically create icons on launch up - for example by overlaying two icons over another?
Dynamic icon creation
-
- Burner Inserter
- Posts: 17
- Joined: Sun Aug 14, 2016 7:38 pm
- Contact:
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Dynamic icon creation
I'm not aware of any image editing features in the API (eg. merging two images) but there are ways to change icon colours (Omni Barrels example) if that would suffice? Also, look at Creative Mode as that somehow puts "eyes" (or whatever they are) over the existing icons.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Dynamic icon creation
You missed the Dynamic Part, I think. That is, he wants the altered Icons to be generated automatically for mod added Icons.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Dynamic icon creation
QuestionIs there any way to dynamically create icons on launch up - for example by overlaying two icons over another?
Answer You can overlay 2 icons.aubergine18 wrote:I'm not aware of any image editing features in the API (eg. merging two images) but there are ways to change icon colours (Omni Barrels example) if that would suffice? Also, look at Creative Mode as that somehow puts "eyes" (or whatever they are) over the existing icons.
But to go deeper what does he mean by dynamic
if he means I am creating Super Coal then in data-updates or data-final-fixes it would be something like this Total off the top of my memory less head
baseicon = data.raw.item[coal].icon
data:extend({
blah
blah
icons = {{icon=baseicon},{icon=myoverlay}}
})
Re: Dynamic icon creation
There's no icon editing functionality in the game.
You can use layers and masks to comprise entity graphics, but same functionality for icons was not implemented.
You can use layers and masks to comprise entity graphics, but same functionality for icons was not implemented.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: Dynamic icon creation
That would be an infinity symbol, not eyes, and it is added by the base game any time that a recipe does not require anything to create (i.e. infinitely available) -- although I do admit, when I look at them they do bear a certain resemblance to a pair of googley eyes.aubergine18 wrote:Also, look at Creative Mode as that somehow puts "eyes" (or whatever they are) over the existing icons.
-
- Burner Inserter
- Posts: 17
- Joined: Sun Aug 14, 2016 7:38 pm
- Contact:
Re: Dynamic icon creation
Actually this works in the latest version. No clue when this was added but you can now use an icons property instead of icon and this can hold multiple layers and also be tinted.Adil wrote:There's no icon editing functionality in the game.
You can use layers and masks to comprise entity graphics, but same functionality for icons was not implemented.
This works now:
Code: Select all
icons= {
{
icon = "__MOD__/some path/image1.png"
tint = {r=1, b=0.5, g=1}
},
{
icon = "__MOD__/some path/image2.png"
tint = {r=1, b=0.5, g=1}
}
}
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Dynamic icon creation
Excellent news! Thanks for sharing SeelenJaegerTee!!
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.