Page 1 of 1

How are styles defined for factorio's GUIs?

Posted: Fri Jun 09, 2017 4:19 am
by Gangsir
If I look on the api, I see that it says I can define a style, which is a string, to use for the newly .add{}-ed gui element, but I can't find any information about how styles are defined. I'd like to be able to reuse styles so I don't have to repeatedly modify the style after the element is created.

I'm assuming it's some kind of data:extend call, unfortunately those are almost completely undocumented with Wube's api.

Re: How are styles defined for factorio's GUIs?

Posted: Fri Jun 09, 2017 7:11 am
by darkfrei
Do you read this?
[GUIDE] How to style buttons with images on them.
viewtopic.php?f=34&t=24007

Re: How are styles defined for factorio's GUIs?

Posted: Fri Jun 09, 2017 9:43 am
by Klonan
Gangsir wrote:If I look on the api, I see that it says I can define a style, which is a string, to use for the newly .add{}-ed gui element, but I can't find any information about how styles are defined. I'd like to be able to reuse styles so I don't have to repeatedly modify the style after the element is created.

I'm assuming it's some kind of data:extend call, unfortunately those are almost completely undocumented with Wube's api.
Its all in data/core/prototypes/style.lua

Re: How are styles defined for factorio's GUIs?

Posted: Sun Jun 11, 2017 1:35 am
by Helfima