public void Draw(string FocusedElementKey, UIRenderer UIRendererInstance) { if (IsScrollable) { int innerHeight = 0; foreach (UIDrawCall child in ChildDrawCalls) { innerHeight += child.Height + child.Element.GetHeight().FullMargin; } int scroll = MathHelper.Clamp(Element.GetScroll(), 0, innerHeight - Height); if (scroll != Element.GetScroll()) { Element.SetScroll(scroll); } UIRendererInstance.EnableScrollingTarget(this); } Element.Draw(Width, Height, X, Y, Element.GetKey() == FocusedElementKey); foreach (UIDrawCall child in ChildDrawCalls) { child.Draw(FocusedElementKey, UIRendererInstance); } if (IsScrollable) { UIRendererInstance.FlipScrollingTarget(this); } }
public UIElement(string Key, UIRenderer UIRendererInstance) { key = Key; uiRendererInstance = UIRendererInstance; isLocked = false; children = new IUIElement[0]; positioning = UIEnums.Positioning.Relative; }
public UIBox(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance) { tint = Color.White; isFilled = true; }
public UIButton(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance) { borderColor = Color.Transparent; }
public void SetUIRendererInstance(UIRenderer Renderer) { uiRendererInstance = Renderer; }
public UILeftRight(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance) { }
public UIIcon(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance) { }