Mod-GUI: Changeable background
Mod-GUI: Changeable background
Allow us to change the background of elements (labels, panes, etc.)
The easy way via background_color (rgba).
The more complicated way via background-tile / background-transparency (sprite getting repeated to fill the area)
The easy way via background_color (rgba).
The more complicated way via background-tile / background-transparency (sprite getting repeated to fill the area)
Re: Mod-GUI: Changeable background
This is already possible with styles: viewtopic.php?f=65&t=57787
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Mod-GUI: Changeable background
Nope, sadly not. The only thing that allows background is the list-box. Which is not available to mods.
Klonan even said so in the mod-making discord
Klonan even said so in the mod-making discord

Klonan - Last Sunday at 4:11 PM
however, background color cannot be changed
Re: Mod-GUI: Changeable background
Then how do you explain the screenshot in the other post? That person is rather obviously using styles to change the background.Godmave wrote:Nope, sadly not. The only thing that allows background is the list-box. Which is not available to mods.
Klonan even said so in the mod-making discord
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Mod-GUI: Changeable background
So you can change the graphical_set, mhh. That would help at least for hard-mods. That would also explain why you can't simply change the background color of things, since the background is an image, not a filled area.
But labels don't have that I think. Will take a longer look in the evening after work.
But labels don't have that I think. Will take a longer look in the evening after work.
Re: Mod-GUI: Changeable background
Labels just draw text, It is not even in the GUI engine to draw any background of a labelGodmave wrote:So you can change the graphical_set, mhh. That would help at least for hard-mods. That would also explain why you can't simply change the background color of things, since the background is an image, not a filled area.
But labels don't have that I think. Will take a longer look in the evening after work.
Re: Mod-GUI: Changeable background
I am just grasping at straws here. I would like to be able to have different colored areas, and set different background on hover for labels, so I can have more different font-colors too.
I tried to create my own version of the list box. Since you can kind of draw stuff on top of each other I tried that with sprites with labels on top. It works, but since you can not stretch sprites (only sprites in sprite-buttons) and I can not add new sprites with higher width in a soft-mod, I hit a road block there too.
I tried to create my own version of the list box. Since you can kind of draw stuff on top of each other I tried that with sprites with labels on top. It works, but since you can not stretch sprites (only sprites in sprite-buttons) and I can not add new sprites with higher width in a soft-mod, I hit a road block there too.
Re: Mod-GUI: Changeable background
In 0.17 we have added LuaGuiElement::listboxGodmave wrote:I am just grasping at straws here. I would like to be able to have different colored areas, and set different background on hover for labels, so I can have more different font-colors too.
I tried to create my own version of the list box. Since you can kind of draw stuff on top of each other I tried that with sprites with labels on top. It works, but since you can not stretch sprites (only sprites in sprite-buttons) and I can not add new sprites with higher width in a soft-mod, I hit a road block there too.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Mod-GUI: Changeable background
@Bilka:
Hah. I was just going to post: Hey! I have a mod that does that! But then i saw you already linked me ;)
Hah. I was just going to post: Hey! I have a mod that does that! But then i saw you already linked me ;)
Labels don't have an "on hover", nor to they have a background. To imitate a listbox you can just use two custom button styles. One which defaults to black, and one which defaults to orange. Then when the player clicks a button you simple change the style on the clicked one and on the last active button. For black/grey/orange that's 3 colors = 3 pixel image.Godmave wrote:I am just grasping at straws here. I would like to be able to have different colored areas, and set different background on hover for labels, so I can have more different font-colors too.
Somewhat. The "image" that is used to fill the background contains exactly one pixel (1x1), which is tiled over the whole area.Godmave wrote:That would also explain why you can't simply change the background color of things, since the background is an image, not a filled area.
Re: Mod-GUI: Changeable background
@eredicator
oh, labels have an on-hover. I already use that. But it is only for the font-color.
what mod would that be?
btw, are you active in the factorio discord? if yes, under which name?
oh, labels have an on-hover. I already use that. But it is only for the font-color.
what mod would that be?
btw, are you active in the factorio discord? if yes, under which name?
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Mod-GUI: Changeable background
@godmeve
Huh, they do indeed. But using labels for clicky things feels wrong :P.
That mod is not public (yet™, someone find me an artist...).
No. I'm on irc only, same name. I prefer explaining things in public though so that other people can find them. So if you have any questions make a modding help topic or somthing.
Huh, they do indeed. But using labels for clicky things feels wrong :P.
That mod is not public (yet™, someone find me an artist...).
No. I'm on irc only, same name. I prefer explaining things in public though so that other people can find them. So if you have any questions make a modding help topic or somthing.
Re: Mod-GUI: Changeable background
Yeah, the only current question was for the mod 
And I don't know how far I can adjust buttons without the need to add new stuff, which I can't in a soft-mod.
But I will look into it some more in the evening. At the moment I got a "good enough" version with labels

And I don't know how far I can adjust buttons without the need to add new stuff, which I can't in a soft-mod.
But I will look into it some more in the evening. At the moment I got a "good enough" version with labels

- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Mod-GUI: Changeable background
If by "soft mod" you mean that you have no access to the data-stage then it's going to be difficult, as you can't make new styles. As all of LuaStyle seems to be writable from the control stage you might still be able to get the buttons to be the right shape by recycling some of the built-in styles, but it's gonna be hacky.
Re: Mod-GUI: Changeable background
Yep, no data stage available for me.
And changing stuff from inside LUA would be easier if you could somehow see which style attributes are available. Atm I always look into the definition. But some of the attributes there are not writeable. So it is a lot of trial and error.
And for the graphics I use the preview from the explorer, take the file name and search that in the lua files to get the name to use
Some kind of kitchensink with descriptions what is possible per thing would really save time for newbies like me.
And more vanilla tools (like the ability to set plain one-color backgrounds without sprites) to change how things look would be nice too for softmods.
0.17 might make that all a bit less important when players don't have to download mods in the right version themselves anymore.
And changing stuff from inside LUA would be easier if you could somehow see which style attributes are available. Atm I always look into the definition. But some of the attributes there are not writeable. So it is a lot of trial and error.
And for the graphics I use the preview from the explorer, take the file name and search that in the lua files to get the name to use

Some kind of kitchensink with descriptions what is possible per thing would really save time for newbies like me.
And more vanilla tools (like the ability to set plain one-color backgrounds without sprites) to change how things look would be nice too for softmods.
0.17 might make that all a bit less important when players don't have to download mods in the right version themselves anymore.