[0.16.51] Modded Item/Entity Icon Spills Outside Borders

Bugs that are actually features.
Post Reply
User avatar
QGamer
Fast Inserter
Fast Inserter
Posts: 213
Joined: Fri Apr 14, 2017 9:27 pm
Contact:

[0.16.51] Modded Item/Entity Icon Spills Outside Borders

Post by QGamer »

What did you do?
I was modding the icon for an entity I'm making.
Here's the code:

Code: Select all

--Non buggy version:
--icons =
--{
--	{ icon = "__base__/graphics/icons/pumpjack.png" },
--	{ icon = "__base__/graphics/icons/stone-furnace.png", scale = 0.5 }
--},

--Buggy version.  The pumpjack spills outside the designated area!
icons =
{
	{ icon = "__base__/graphics/icons/stone-furnace.png", scale = 0.5 },
	{ icon = "__base__/graphics/icons/pumpjack.png" }
},
What happened instead?
Something here is amiss.
Something here is amiss.
Icon_bug.jpg (95.48 KiB) Viewed 861 times
When I used the first block of code above, the image is fine and perfectly normal. The pumpjack is in front. The mini stone furnace is in front.
The second block of code though, is weird. The stone furnace is normal size, and the pumpjack is 2x size, spilling outside the borders of the icon frame (see the attached picture).
Also, the pumpjack is still drawn in front, even though I wanted it drawn in back.
If I make the stone furnace scale 0.1 instead of 0.5, it's still normal size, but the pumpjack is at 10x size!
Then if I set the pumpjack scale to 1 like this:

Code: Select all

icons =
{
	{ icon = "__base__/graphics/icons/stone-furnace.png", scale = 0.5 },
	{ icon = "__base__/graphics/icons/pumpjack.png", scale = 1 }
},
It has no effect. The pumpjack is still at 2x scale.
What did you expect to happen instead?
I expected the stone furnace to be drawn in front (because I swapped the order of the icons, I wanted them to be drawn in reverse order).
I expected it to be drawn at half-size, and the pumpjack to be normal size.
Steps to reproduce:
1) Change the icon of any item or entity to use the code above.
2) Run the game.
3) Open the crafting menu or the production statistics screen

Edit: actually, reversing the order of the items does change the draw order, but I was too blind to see it. When I put the pumpjack icon first, it shows up at the bottom (as I'd expect). So I changed the wording of this bug report. The drawing order is okay, but the fact that the pumpjack is too big is not good.
Attachments
factorio-current.log
The log file.
(4.44 KiB) Downloaded 50 times
"Adam fell that men might be; and men are, that they might have joy."

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] Modded Item/Entity Icon Spills Outside Borders

Post by Rseding91 »

Thanks for the report however that's working as intended. The way item icon rendering works is:

1. Take what ever the first icon is and scale it to fit 32x32
2. Take that scale and also apply it to everything other layer after that (scale the entire set of layered icons)

We don't support having icons != 32x32 right now.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”