Page 1 of 1

Reading a GUI element's current width?

Posted: Sat Aug 01, 2015 1:17 pm
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?

Re: Reading a GUI element's current width?

Posted: Sat Aug 01, 2015 1:21 pm
by Xyfi
I believe it's minimum_width and maximum_width.

Re: Reading a GUI element's current width?

Posted: Sat Aug 01, 2015 1:24 pm
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.

Re: Reading a GUI element's current width?

Posted: Sat Aug 01, 2015 1:30 pm
by Outsider
i think it's actually minimal_width and minimal_height not sure we have read access to them tho

Re: Reading a GUI element's current width?

Posted: Sat Aug 01, 2015 1:33 pm
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.