How are styles defined for factorio's GUIs?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Gangsir
Inserter
Inserter
Posts: 20
Joined: Fri Jul 15, 2016 4:50 pm
Contact:

How are styles defined for factorio's GUIs?

Post 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.
I'm an administrator over at the Factorio wiki. If you have any questions about the wiki, or concerns, please do not hesitate to contact me. I'm on the subreddit (/r/factorio, /u/Gangsir) as well.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

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

Post by darkfrei »

Do you read this?
[GUIDE] How to style buttons with images on them.
viewtopic.php?f=34&t=24007

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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


Post Reply

Return to “Modding help”