public void ScrollIntoView(GuiWidget widget) { if (this.Descendants().Contains(widget)) { if (!widget.ActuallyVisibleOnScreen()) { var widgetScreenBounds = widget.TransformToScreenSpace(widget.LocalBounds); var widgetScrollBounds = this.TransformFromScreenSpace(widgetScreenBounds.Center); this.ScrollPosition = new Vector2(0, -widgetScrollBounds.Y); } } }
public bool NameExists(string widgetName, SearchRegion searchRegion = null) { foreach (SystemWindow window in SystemWindow.OpenWindows) { GuiWidget widgetToClick = window.FindNamedChildRecursive(widgetName); if (widgetToClick != null) { if (widgetToClick.ActuallyVisibleOnScreen()) { return(true); } } } return(false); }