Reading a GUI element's current width?

Place to get help with not working mods / modding interface.
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Reading a GUI element's current width?

Post by Narc »

I've only tried this from the console yet, so forgive me if doing it from within the mod that created the GUI will give better results, but I only ever seem to get `nil` when trying to read a GUI element's `width` property (and the `element.style` has no such property at all).

I don't intend to assign to the width at any point, but would instead just like to find out how wide the visual element currently is. Is this possible, or should I be making a modding interface request?
Xyfi
Inserter
Inserter
Posts: 40
Joined: Tue May 20, 2014 7:10 am
Contact:

Re: Reading a GUI element's current width?

Post by Xyfi »

I believe it's minimum_width and maximum_width.
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Reading a GUI element's current width?

Post by Narc »

Xyfi wrote:I believe it's minimum_width and maximum_width.
Those are part of `element.style`, and they're also `nil` unless the style calls for them to be set by default.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: Reading a GUI element's current width?

Post by Outsider »

i think it's actually minimal_width and minimal_height not sure we have read access to them tho
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Reading a GUI element's current width?

Post by Narc »

They're still `nil` by default, just as I said five minutes ago. Also, those are the minimum width and height, not the current values.
Post Reply

Return to “Modding help”