Page 1 of 1
Current visibility check for GUI elements
Posted: Tue Aug 12, 2025 11:50 pm
by scruffyvoltherder
For GUIs that need to display large amounts of changing information inside a scroll-pane, It would be very useful to be able to tell which GUI elements are actually currently visible in order to avoid having to update large numbers of invisible elements.
I'm thinking either a boolean variable or a boolean function to check if the element is currently visible on screen. For a flow or tab, it would be considered visible if any sub-element is visible.
Re: Current visibility check for GUI elements
Posted: Wed Aug 13, 2025 9:11 am
by Pi-C
scruffyvoltherder wrote: Tue Aug 12, 2025 11:50 pm
[...] It would be very useful to be able to tell which GUI elements are actually currently visible in order to avoid having to update large numbers of invisible elements. [...] For a flow or tab, it would be considered visible if any sub-element is visible.
But what about mods that make frames/flows/tables invisible so they don't have to update the "visible" flag of large numbers of elements within these containers? That's what I do in some of my mods.

Re: Current visibility check for GUI elements
Posted: Thu Aug 14, 2025 2:59 am
by scruffyvoltherder
Pi-C wrote: Wed Aug 13, 2025 9:11 am
scruffyvoltherder wrote: Tue Aug 12, 2025 11:50 pm
[...] It would be very useful to be able to tell which GUI elements are actually currently visible in order to avoid having to update large numbers of invisible elements. [...] For a flow or tab, it would be considered visible if any sub-element is visible.
But what about mods that make frames/flows/tables invisible so they don't have to update the "visible" flag of large numbers of elements within these containers? That's what I do in some of my mods.
If you made the frame or flow invisible, none of its sub-elements would be rendered, so it would not be considered currently visible.
Re: Current visibility check for GUI elements
Posted: Thu Aug 14, 2025 5:35 am
by boskid
This feels unlikely because visibility is not part of game state and as such it would require sending input actions each time visibility changes. That would be a lot of data that could be changing each tick causing significant network traffic when playing MP.
Re: Current visibility check for GUI elements
Posted: Thu Aug 14, 2025 5:08 pm
by scruffyvoltherder
I imagine that being able to read element sizes and the scroll-pane scrollbar positions would run into the same problems?
I'll probably just have to manage scrolling with up/down buttons. Would it be possible to get a vertical slider component?