Ejemplo n.º 1
0
        public Panel(Vector2 size, LayoutBorder padding) : base(size, padding)
        {
            // Add background and border
            var border = new Rect()
            {
                Color = Colors.Black
            };

            border.AddComponent(new Layout()
            {
                Fill          = new Vector2(1),
                IgnorePadding = true
            });

            var b          = 60;
            var background = new Rect()
            {
                Color = new Color(b, b, b)
            };

            background.AddComponent(new MouseInput());
            background.AddComponent(new Layout()
            {
                Margin        = new LayoutBorder(1),
                Fill          = new Vector2(1),
                IgnorePadding = true,
            });
            AddChild(border);
            AddChild(background);
        }
Ejemplo n.º 2
0
 public Container(Vector2 size, LayoutBorder padding = default(LayoutBorder), Vector2 offset = default(Vector2))
 {
     Size    = size;
     Padding = padding;
     Offset  = offset;
 }