Read access for LuaGuiElement.width and height (or LuaGuiElement.style.width)

Things that we aren't going to implement
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 412
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Read access for LuaGuiElement.width and height (or LuaGuiElement.style.width)

Post by protocol_1903 »

As in title, I want to be able to find out the current width and height of a LuiGuiElement. It doesn't quite make sense to access via LuaStyle but that might be the better place for it. Specifically, I want to know what the width/height is based on the style settings (padding, margins, natural_width, minimum, maximum).
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
Rseding91
Factorio Staff
Factorio Staff
Posts: 16355
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Read access for LuaGuiElement.width and height (or LuaGuiElement.style.width)

Post by Rseding91 »

The current width/height of a GUI element is not available for mods to read because it's not part of the game state (it only exists for the player viewing the GUI). If we were to make it part of the game state then we would need to sync it through the multiplayer networking system for every player every time any of them change size.

That is currently not something we're interested in doing.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't implement”