Current visibility check for GUI elements

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
scruffyvoltherder
Inserter
Inserter
Posts: 28
Joined: Fri Jun 14, 2024 12:33 am
Contact:

Current visibility check for GUI elements

Post 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.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1760
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Current visibility check for GUI elements

Post 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. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
scruffyvoltherder
Inserter
Inserter
Posts: 28
Joined: Fri Jun 14, 2024 12:33 am
Contact:

Re: Current visibility check for GUI elements

Post 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.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4062
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Current visibility check for GUI elements

Post 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.
scruffyvoltherder
Inserter
Inserter
Posts: 28
Joined: Fri Jun 14, 2024 12:33 am
Contact:

Re: Current visibility check for GUI elements

Post 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?
Post Reply

Return to “Modding interface requests”