Dynamic icon creation

Place to get help with not working mods / modding interface.
SeelenJaegerTee
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Aug 14, 2016 7:38 pm
Contact:

Dynamic icon creation

Post by SeelenJaegerTee »

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?
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Dynamic icon creation

Post by aubergine18 »

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.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Dynamic icon creation

Post by Ranakastrasz »

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
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Dynamic icon creation

Post by Nexela »

Is there any way to dynamically create icons on launch up - for example by overlaying two icons over another?
Question
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.
Answer :) You can overlay 2 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}}
})
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Dynamic icon creation

Post by Adil »

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.
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.
Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: Dynamic icon creation

Post by Supercheese »

aubergine18 wrote:Also, look at Creative Mode as that somehow puts "eyes" (or whatever they are) over the existing icons.
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. :shock: :lol:
SeelenJaegerTee
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Aug 14, 2016 7:38 pm
Contact:

Re: Dynamic icon creation

Post by SeelenJaegerTee »

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

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}
			}
}
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Dynamic icon creation

Post by aubergine18 »

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.
Post Reply

Return to “Modding help”