[kovarex] GUI graphics not behaving when using layers

Things that we don't consider worth fixing at this moment.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

[kovarex] GUI graphics not behaving when using layers

Post by bobingabout »

same mod again, updated the code though, still applies to other bug.
https://www.dropbox.com/s/1ynlcf7ej1bkv ... P.rar?dl=0

if you look in the styles.lua file, you'll see 2 blocks of code, 1 commented out.

the method I tried first was to draw the button graphics once, and use layers to overlay the icon onto the button.(That's the configuration in the file as it is) this was the result.
https://www.dropbox.com/s/v0w73ap3se9m2 ... 4.png?dl=0

As you can see, it doesn't look right.
Example snippet of the layer code:

Code: Select all

      default_graphical_set =
      {
        type = "monolith",
        monolith_image =
        {
          layers =
          {
            {
              filename = "__bobclasses__/buttons/button.png",
              priority = "extra-high-no-scale",
              load_in_minimal_mode = true,
              width = 36,
              height = 36,
            },
            {
              filename = filename,
              priority = "extra-high-no-scale",
              load_in_minimal_mode = true,
              width = 32,
              height = 32,
              shift = {2, 2}
            }
          }
        }
      },

As a result, I then went and edited the graphics so each button had it's own set of image files. (commented out in the mod), this is the result.
https://www.dropbox.com/s/wi2v1633a22ae ... 8.png?dl=0

As you can see, everything looks as you would expect.


Am I doing something wrong, or is this some sort of bug?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: GUI graphics not behaving when using layers

Post by kovarex »

The layers should be fixed, but also, for this case you should definetly use the sprite-button right?
http://lua-api.factorio.com/latest/LuaGuiElement.html

With the sprite button, you can set any image to the button in runtime without having to set special style for it.
Also, apart custom images, you can use generic names like "item/iron-plate" etc. (http://lua-api.factorio.com/latest/Conc ... SpritePath)
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [kovarex] GUI graphics not behaving when using layers

Post by kovarex »

I checked the layers in the styles and .. well I spent like 5 hours with that and and figured out all the problems related to sprites and gui, so I'm going to say, just use the sprite button and don't use layers in styles and lets call it a day :)
Post Reply

Return to “Won't fix.”