Enable layer property in SpriteVariations type

Things that already exist in the current mod API
Post Reply
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 416
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Enable layer property in SpriteVariations type

Post 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?

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Enable layer property in SpriteVariations type

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 416
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Enable layer property in SpriteVariations type

Post 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

Post Reply

Return to “Already exists”