Пример #1
0
 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);
     }
 }
Пример #2
0
 public UIElement(string Key, UIRenderer UIRendererInstance)
 {
     key = Key;
     uiRendererInstance = UIRendererInstance;
     isLocked           = false;
     children           = new IUIElement[0];
     positioning        = UIEnums.Positioning.Relative;
 }
Пример #3
0
 public UIBox(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance)
 {
     tint     = Color.White;
     isFilled = true;
 }
Пример #4
0
 public UIButton(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance)
 {
     borderColor = Color.Transparent;
 }
Пример #5
0
 public void SetUIRendererInstance(UIRenderer Renderer)
 {
     uiRendererInstance = Renderer;
 }
Пример #6
0
 public UILeftRight(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance)
 {
 }
Пример #7
0
 public UIIcon(string Key, UIRenderer UIRendererInstance) : base(Key, UIRendererInstance)
 {
 }