Page 1 of 1

Dynamic icon creation

Posted: Sun Aug 14, 2016 9:34 pm
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?

Re: Dynamic icon creation

Posted: Sun Aug 14, 2016 10:52 pm
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.

Re: Dynamic icon creation

Posted: Mon Aug 15, 2016 12:47 am
by Ranakastrasz
You missed the Dynamic Part, I think. That is, he wants the altered Icons to be generated automatically for mod added Icons.

Re: Dynamic icon creation

Posted: Mon Aug 15, 2016 2:08 am
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}}
})

Re: Dynamic icon creation

Posted: Mon Aug 15, 2016 3:19 am
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.

Re: Dynamic icon creation

Posted: Wed Aug 17, 2016 9:31 pm
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:

Re: Dynamic icon creation

Posted: Mon Aug 22, 2016 12:19 am
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}
			}
}

Re: Dynamic icon creation

Posted: Mon Aug 22, 2016 2:13 am
by aubergine18
Excellent news! Thanks for sharing SeelenJaegerTee!!