Page 1 of 1

[1.1.34] Modding: graphics errors with layered recipe icons.

Posted: Sun Jun 06, 2021 11:43 am
by everything-narrative
Description
The bug manifests as a strange rendering of recipe icon generated using the

Code: Select all

icons
property for layered icons.

First, when rendering on an assembler in alt-mode, the top layer isn't properly shadowed:
crush-brick-icon-error.png
crush-brick-icon-error.png (119.12 KiB) Viewed 2402 times
Second, when rendering in the crafting menu, the icon spills out of bounds:
crush-brick-icon-error-2.png
crush-brick-icon-error-2.png (180.02 KiB) Viewed 2402 times
How to replicate
A mod with the following `data.lua` file was used to generate this error

Code: Select all

data:extend{
  {
    type='recipe',
    name='crush-brick',
    enabled='true',
    ingredients = { { 'stone-brick', 1 } },
    result = 'stone',
    energy_required = 0.5,
    category = 'advanced-crafting',
    icon_size = 64,
    icon_mipmaps = 4,
    icons = {
      {
        icon = '__base__/graphics/icons/stone-brick.png',
        icon_size = 64,
        icon_mipmaps = 4,
        scale = 0.3,
        shift = {-7, -7},
      },
      {
        icon = '__base__/graphics/icons/stone.png',
        icon_size = 64,
        icon_mipmaps = 4,
        scale = 0.3,
        shift = {7, 7},
      },
    },
  }
}
Expected behavior
The alt-mode recipe graphic should be properly outlined in shadow to maximize legibility.

Additionally, the recipe icon should at the very least be clipped to fit within the recipe "button."
Further complaints
The documentation for the `Types/IconData` is ambiguous on the exact behavior of the `scale` and `shift` properties.

Re: [1.1.34] Modding: graphics errors with layered recipe icons.

Posted: Sun Jun 06, 2021 7:07 pm
by posila
Thanks for the report.
None of this is a bug. Icon layers are borderline unusable except for the case in vanilla for which they were added (barrel recipes) but that's not a bug.

viewtopic.php?p=434010#p434010

I am considering redesigning icon layer definitions for the expansion, though.

Re: [1.1.34] Modding: graphics errors with layered recipe icons.

Posted: Mon Jun 07, 2021 9:46 am
by everything-narrative
posila wrote: Sun Jun 06, 2021 7:07 pm Thanks for the report.
None of this is a bug. Icon layers are borderline unusable except for the case in vanilla for which they were added (barrel recipes) but that's not a bug.

viewtopic.php?p=434010#p434010

I am considering redesigning icon layer definitions for the expansion, though.
Could this note be added to the documentation?
Icon layering was designed for barrel recipes, and are not feature-rich enough to create general icon graphics. It is recommended to use image editing software for the creation of new icons.

Re: [1.1.34] Modding: graphics errors with layered recipe icons.

Posted: Sun Oct 16, 2022 8:06 pm
by Stringweasel
Another limitation seems to be when layers icons need to fade. I saw two cases:
  • Alerts flashing
  • The "filtered" slots in an assembler that's faded.
Each layer is faded individually, meaning where they overlap is a brighter spot. Looks kinda odd.

Image

I just took a few hours to untangle my 8 icons into a modular and easy-to-use system. Guess I need to change it back :roll: :mrgreen: