[Solved] How to change button width in 0.17?

Place to get help with not working mods / modding interface.
Schallfalke
Fast Inserter
Fast Inserter
Posts: 162
Joined: Sun Oct 28, 2018 7:57 am
Contact:

[Solved] How to change button width in 0.17?

Post by Schallfalke »

I am working on updating my mods to new version.
But I found the default GUI style have changed. Notably, the button has gone unnecessarily elongated, which makes my 0.16 code looks bad.
How could I adjust the width of "button" type?
0.16.51 vs 0.17.3
0.16.51 vs 0.17.3
ButtonWidth.jpg (49.26 KiB) Viewed 1348 times
Last edited by Schallfalke on Sat Mar 02, 2019 4:16 pm, edited 1 time in total.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5412
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: How to change button width in 0.17?

Post by Klonan »

button.style.width, button.style.natural_width, button.style.minimal_width, button.style.maximal_width...

Take your pick
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How to change button width in 0.17?

Post by darkfrei »

Klonan wrote: Fri Mar 01, 2019 7:46 am button.style.width, button.style.natural_width, button.style.minimal_width, button.style.maximal_width...

Take your pick
Is here in vanilla someone standard style button with compact size? Default compact text style?
Schallfalke
Fast Inserter
Fast Inserter
Posts: 162
Joined: Sun Oct 28, 2018 7:57 am
Contact:

Re: How to change button width in 0.17?

Post by Schallfalke »

Thank you.

Though the shrinked text button does not look as nice as in 0.16, like font change, button background colour, etc. I cannot find any documentation on default styles, so cannot mimic the original style fully.
Anyway, I will instead use a sprite button here, sounds much easier than fighting with style settings...

EDIT: Just found a lot of settings in core\prototypes\style.lua. I will see if there is anything I can use from there...
Post Reply

Return to “Modding help”