Query about icon scaling
Posted: Thu Mar 01, 2018 11:57 am
This is a quirk (seems to me) with scaling for layered icons, just wanted to know if this is working as intended or if it could be a feature request or even a bug.
If you do something like this:
then the icon is rendered as if all three scales were 1. It's as though the scale for every layer after the first is actually based on the scale of the first layer. If the first layer is scaled to 0.5 then it still fills the 32x32 "window" for the icon and all the scales of the successive layers are rendered in whatever proportion they have to 0.5.
Use case: I'm auto-generating icons based on existing icons. I want three of them scaled down slightly, with different offsets. They have to be scaled down because icons exist which fill the available space, so they need to be shrunk slightly for the offset. To make this work, I have to insert a completely transparent .png as the first layer with a scale of 1, adding CPU and maybe GPU overhead. This might be insignificant but the icons concerned are for things which appear on belts, so there could be literally thousands of them on-screen at any one time.
Does this seem odd to anyone else?
If you do something like this:
Code: Select all
itemcopy.icons = {
{
icon = "__whatever__/path-to-something.png",
scale = 0.75,
shift = {0, -3},
},
{
icon = "__whatever__/path-to-something.png",
scale = 0.75,
shift = {0, 0},
},
{
icon = "__whatever__/path-to-something.png",
scale = 0.75,
shift = {0, 3},
},
}
Use case: I'm auto-generating icons based on existing icons. I want three of them scaled down slightly, with different offsets. They have to be scaled down because icons exist which fill the available space, so they need to be shrunk slightly for the offset. To make this work, I have to insert a completely transparent .png as the first layer with a scale of 1, adding CPU and maybe GPU overhead. This might be insignificant but the icons concerned are for things which appear on belts, so there could be literally thousands of them on-screen at any one time.
Does this seem odd to anyone else?