Which LuaGuiElement is in front?
Posted: Fri Apr 29, 2022 5:34 pm
My mod has 2 GUIs on player.gui.screen. When I turn them on, I will use LuaGuiElement.bring_to_front() to make sure they are visible. One of them ("Available characters") can become quite small, as you can see in this screenshot:
Is there any way to find out whether a particular GUI element is hidden, or at least if it is on top? If so, I could check whether my GUI is visible but possibly hidden and bring it to the front instead of turning it off when the toggle button is used.
In this case the small GUI is on top, so it is visible. But if the bigger GUI gets the focus, the small one will be completely hidden. The button flow at the top left of the screen contains the buttons that toggle GUI visibility. Now, if the small GUI is hidden by something else, clicking the "Available characters" button will (apparently!) do nothing: The GUI already is visible, so using the button will make it invisible, and only on the next click will it be visible (and in the foreground) again.Is there any way to find out whether a particular GUI element is hidden, or at least if it is on top? If so, I could check whether my GUI is visible but possibly hidden and bring it to the front instead of turning it off when the toggle button is used.