Exemplo n.º 1
0
 public UIButton(float x, float y, float width, float height, string text, UIContainer parent, UISizeMethod sizing = UISizeMethod.UV) : base(x, y, width, height, parent, sizing)
 {
     label = new UILabel(0, 0, 1, 1, text, this, UISizeMethod.UV, UIAlignment.Center)
     {
         color = Color.Black
     };
 }
Exemplo n.º 2
0
        public UIDropDown(float x, float y, float width, float height, UIContainer parent, UISizeMethod sizing = UISizeMethod.UV) : base(x, y, width, height, "---", parent, sizing)
        {
            new UIImage(0, 0, 1, 1, Textures.UI.DropDownArrow, label, UISizeMethod.UV);

            Click += (object sender, EventArgs e) =>
            {
                isOpen = !isOpen;
            };
        }
Exemplo n.º 3
0
        public override void Draw(SpriteBatch spriteBatch, int currentHover)
        {
            if (!HasFocus())
            {
                isOpen = false;
            }

            for (int i = 1; i < children.Count; i++)
            {
                UIContainer element = children[i];
                if (isOpen)
                {
                    element.Show();
                }
                else
                {
                    element.Hide();
                }
            }

            base.Draw(spriteBatch, currentHover);
        }
Exemplo n.º 4
0
 public UILabel(float x, float y, float width, float height, string text, UIContainer parent = null, UISizeMethod sizing = UISizeMethod.UV, UIAlignment alignment = UIAlignment.Center) : base(x, y, width, height, parent, sizing)
 {
     Text           = text;
     this.alignment = alignment;
 }
Exemplo n.º 5
0
 public UIInteractable(float x, float y, float width, float height, UIContainer parent = null, UISizeMethod sizing = UISizeMethod.UV) : base(x, y, width, height, parent, sizing)
 {
 }
Exemplo n.º 6
0
 public UIImage(float x, float y, float width, float height, Texture2D texture, UIContainer parent = null, UISizeMethod sizing = UISizeMethod.UV) : base(x, y, width, height, parent, sizing)
 {
     this.texture = texture;
 }