Exemplo n.º 1
0
        public GuiContainer AddContainer()
        {
            var container = new GuiContainer(Gui, this);

            AddControl(container);

            return(container);
        }
Exemplo n.º 2
0
 internal GuiContainer(Gui gui, GuiContainer parent) : base(gui, parent)
 {
     w        = 0;
     h        = 0;
     x        = 0;
     y        = 0;
     children =
         new List <GuiControl>();
 }
Exemplo n.º 3
0
        private void RecalculateLayout(GuiContainer container)
        {
            container.DoLayout();

            for (int i = 0; i < container.children.Count; i++)
            {
                var control = container.children[i];

                if (control is GuiContainer containerChild)
                {
                    RecalculateLayout(containerChild);
                }
            }
        }
Exemplo n.º 4
0
        private void RecalculateSize(GuiContainer container)
        {
            for (int i = 0; i < container.children.Count; i++)
            {
                var control = container.children[i];

                if (control is GuiContainer containerChild)
                {
                    RecalculateSize(containerChild);
                }
            }

            container.DoAutoSize();
        }
Exemplo n.º 5
0
        public Gui()
        {
            var width  = Game.Instance.Canvas.Width;
            var height = Game.Instance.Canvas.Height;

            Game.Instance.Platform.OnWinResized += OnWinResized;

            mouse_state = new GuiMouseState();

            theme = new DefaultTheme(Game.Instance.Canvas.DefaultFont);

            root = new GuiContainer(this, width, height);

            surface = Game.Instance.Canvas.AddSurface(Rect.FromBox(0, 0, width, height), "GuiSurface");

            Game.Instance.AddComponent(this);
        }
Exemplo n.º 6
0
 internal GuiButton(Gui gui, GuiContainer parent) : base(gui, parent)
 {
 }