Page 1 of 1

Enable layer property in SpriteVariations type

Posted: Wed Apr 08, 2020 11:51 pm
by kirazy
https://wiki.factorio.com/Types/SpriteVariations

Currently SpriteVariations inherets all the properties of the Sprite prototype, but Layers is specifically disallowed.

Icon/icons is able to have multiple layers (allowing one to, for example, have a tintable mask), but the pictures definition does not share this ability (as far as I understand the definition?).

In my mods I use masks to color entities, and I had been hoping to provide for two main abilities where the icons are concerned:
1. Have configurable icon colors, so the player can choose what the colors are
2. Choose whether or not to display "tier" pips.

Discussed in particular in this thread: viewtopic.php?p=484140#p484140

The issue is that without layer support in SpriteVariations, I can't do both 1 and 2 at the same time, and avoid having the pips appear when an item is on the ground:
Image

I had hoped to avoid having pips on items on the ground by using the pictures field per Posila's comment, but it turns out I can't use the pictures field with layer masks (I believe?). I don't want to abandon the dream of user-customizable color settings... if possible.

I understand there are performance concerns with having layered icons (why can't we bake these during startup, excluding the runtime masks, and avoid the trouble? D:) but I hope maybe for modding purposes the property would be enabled? :D

Semi-related, as an aside: Is there a way to disable rendering the additional icon layers with a shadow?

Re: Enable layer property in SpriteVariations type

Posted: Thu Apr 09, 2020 7:11 am
by Bilka
kirazy wrote:
Wed Apr 08, 2020 11:51 pm
https://wiki.factorio.com/Types/SpriteVariations

Currently SpriteVariations inherets all the properties of the Sprite prototype, but Layers is specifically disallowed.
The documentation was wrong, it supports layers. It doesn't support slice.

Re: Enable layer property in SpriteVariations type

Posted: Thu Apr 09, 2020 7:29 am
by kirazy
Bilka wrote:
Thu Apr 09, 2020 7:11 am
kirazy wrote:
Wed Apr 08, 2020 11:51 pm
https://wiki.factorio.com/Types/SpriteVariations

Currently SpriteVariations inherets all the properties of the Sprite prototype, but Layers is specifically disallowed.
The documentation was wrong, it supports layers. It doesn't support slice.
Thank God. <3