Read access for LuaGuiElement.width and height (or LuaGuiElement.style.width)
- protocol_1903
- Filter Inserter

- Posts: 412
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Read access for LuaGuiElement.width and height (or LuaGuiElement.style.width)
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
https://mods.factorio.com/user/protocol_1903
Re: Read access for LuaGuiElement.width and height (or LuaGuiElement.style.width)
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.
That is currently not something we're interested in doing.
If you want to get ahold of me I'm almost always on Discord.
