currently it is too hard to tell if a GUIObject is visible, while we do have .Visible it is not enough because ScreenGui.Enabled, GUIObject.ClipDescendants and GUIObject.Position also affects the GUIObject visibility.
I want to check if a GUIObject is visible on screen or not easily without having to worry about other things that can influence the GUIObject being rendered on screen or not
I support this feature since currently I have a function that iterates through the Instance’s ancestors to know if they are visible or not. I do not account for object’s being transparent, not loaded, or if they are even in the screen. That said, make it so the new method tells us if the GuiObject can be seen by the user.
.Rendering property or :IsVisible() method, would be great. I currently have a while loop that plays some effect while a button is visible. So, I currently have to iterate through all ancestors every frame to know if I should stop the effect or start it again.
I would prefer a .Rendering property that way I can listen to the Changed event and trigger the effect when the value it’s true. However, if this would affect performance, then adding the :IsVisible method would perform the checks I mentioned and tell us if is rendering when we call it.
It depends on what the developer believes ‘Visible’ means. Is it visible because any pixel of the frame is drawn? Is it visible because it’s Visible property is true, and all of it’s ancestors are also Visible? Does that also include the ScreenGui being enabled? Is it visible because it’s in the bounds of the screen or frame it’s in? Is it Visible even if something is fully covering it up, which overwise would have made it visible?
It’s more reliable and efficient to just make a script to calculate exactly what you need, to see if it’s ‘Visible’ to you.
I would consider if the UI was visible even by a pixel, a function could be implemented to return the size of the rendered frame (such as UDim2.new(0,2,0,2) from a UDim2.new(0,50,0,50) sized frame). UICorners and other visualization Instances would count aswell, might affect performance though.