Page 1 of 1

Does icon_size really have any affect?

Posted: Sun Jan 14, 2018 12:24 pm
by Zomis
The icon_size property was introduced not so long ago, but does it really have any effect at the moment? What happens if I enter the wrong value?

Re: Does icon_size really have any affect?

Posted: Sun Jan 14, 2018 12:28 pm
by posila
Your mod will either cause an error on startup or the icon won't be properly sized in game.

Re: Does icon_size really have any affect?

Posted: Sun Jan 14, 2018 1:14 pm
by darkfrei
posila wrote:Your mod will either cause an error on startup or the icon won't be properly sized in game.
Why we haven't default value? If not specified, then 32.

Re: Does icon_size really have any affect?

Posted: Sun Jan 14, 2018 1:29 pm
by Bilka
darkfrei wrote:Why we haven't default value? If not specified, then 32.
Because that's not the right size for like half of the icons? It's better to define it everywhere than to use a default that might/will change in the future.

Re: Does icon_size really have any affect?

Posted: Mon Jan 15, 2018 9:44 am
by bobingabout
Zomis wrote:The icon_size property was introduced not so long ago, but does it really have any effect at the moment? What happens if I enter the wrong value?
The original question (topic). Yes. It has an effect. Currently all item icons are 32, but others like Technology are 128, and categories (tabs at the top when you open the crafting menu) are 64.

Those USED TO BE hard values, except technology, that was 128 if it was base game, and 64 for mods, unless you specified an icon_size tag.
This was strange, and meant you needed to add icon_size to all technology to make it work as expected. Which is the reason the default value was removed, forcing you to add the tag to all icons in 0.16.

Back in earlier versions (0.12 and earlier, etc), icon sizes for technology were automatic, just give it a file, and it scaled to fit. it was late 0.12 when they changed the research GUI that they introduced the icon_size fiasco, because the rules were all over the place (128 for the newly introduced base game icons, but 64 for mods, and if your mod was using a 32 size icon, it wouldn't be resized, just centred.)

To get back to the quoted question, if you for example have an icon you want to use for a technology, and a tab, and an item... you can use the same graphic in say, 64x64, and specify icon_size = 64 in all cases. Technology graphics will scale up, item graphics will scale down.
darkfrei wrote:Why we haven't default value? If not specified, then 32.
As specified above, it used to be. I'm not entirely sure why they decided to remove the default of 32 from items, recipes and entities, or the default of 64 from categories, but... they did. Even a default of 128 for technology would have been fine instead of doing what they did in 0.12 to 0.15, the issue is that it was inconsistent, and changing the defaults around over time was causing mods that didn't change the icon size caused loading errors.
Bilka wrote:Because that's not the right size for like half of the icons? It's better to define it everywhere than to use a default that might/will change in the future.
That's where you have different defaults for different things, 32 for items, recipes and entities, 64 for categories, and 128 for technology. The default should be whatever is appropriate for the situation.


In any case, it doesn't really matter, we do have an icon_size tag now, and those who have only just started modding will not know it was never there, while those of us who have been modding for a long time... well... if you've been modding as long as me, you'll just shrug and get on with it, just another change in a long list of changes, some more pointless, and some very revolutionary. This one is just "Meh" *Shrug* to me... A pain in the backside going through and adding it to everything, but at the end of the day, it does make sense, and doesn't add or remove anything from the game.

Re: Does icon_size really have any affect?

Posted: Tue Jan 23, 2018 1:56 am
by Supercheese
Well, you can now use high-resolution icons, so they won't be badly pixelated when zoomed in!