Ejemplo n.º 1
0
        private void InitializeGui()
        {
            gui = new GuiManager(Context.Input, Context.Graphics.Device, Context.Graphics.SpriteBatch);

            // Radar
            radarLogic.Initialize(Context, player, gameClient.ServerEntities);
            gui.Elements.Add(radarLogic.Radar);

            // Weapon
            weaponBar = new WeaponBar();
            weaponBar.Initialize(Context);
            gui.Elements.Add(weaponBar);

            // Health
            healthBar = new HealthBar();
            healthBar.Initialize(Context);
            gui.Elements.Add(healthBar);

            // Notifications
            notifications = new Notifications();
            notifications.Initialize(Context, 10);
            gui.Elements.Add(notifications);

            gui.UpdateLayout();
        }
Ejemplo n.º 2
0
        public void InitializeGui(GuiManager gui)
        {
            menuOptions = new StackPanel();
            menuOptions.HorizontalAlignment = HorizontalAlignment.Left;
            menuOptions.VerticalAlignment = VerticalAlignment.Center;
            menuOptions.Margin = new Thickness(100, 40, 0, 0);
            menuOptions.Width = 176;
            menuOptions.Height = 400;
            menuOptions.Spacing.Bottom = 32;
            gui.Elements.Add(menuOptions);

            for (int i = 0; i < 5; i++)
            {
                menuOptions.Children.Add(GetMenuOption(i));
            }

            gui.UpdateLayout();
        }
Ejemplo n.º 3
0
        public void InitializeGui(GuiManager gui)
        {
            this.gui = gui;

            panel = new Panel();
            panel.HorizontalAlignment = HorizontalAlignment.Left;
            panel.VerticalAlignment = VerticalAlignment.Top;
            panel.Width = Context.View.Area.Width;
            panel.Height = Context.View.Area.Height;
            gui.Elements.Add(panel);

            menuOptions = new StackPanel();
            menuOptions.HorizontalAlignment = HorizontalAlignment.Left;
            menuOptions.VerticalAlignment = VerticalAlignment.Center;
            menuOptions.Margin = new Thickness(100, 40, 0, 0);
            menuOptions.Width = 176;
            menuOptions.Height = 400;
            menuOptions.Spacing.Bottom = 32;
            panel.Children.Add(menuOptions);

            // Add the address textbox to the stackpanel
            var textBoxInfo = new TextBoxInfo()
            {
                MaxLength = 100,
                SpriteFont = Context.Resources.Fonts["Global.Normal"],
                Background = Context.Resources.Textures["MainMenu.TextBox"]
            };
            textBoxIp = new TextBox("", textBoxInfo);
            textBoxIp.HorizontalAlignment = HorizontalAlignment.Left;
            textBoxIp.VerticalAlignment = VerticalAlignment.Top;
            textBoxIp.Width = 220;
            textBoxIp.Text = "";
            textBoxIp.EnterKeyDown += textBoxIp_EnterKeyDown;
            menuOptions.Children.Add(textBoxIp);

            for (int i = 0; i < 2; i++)
            {
                menuOptions.Children.Add(GetMenuOption(i));
            }

            gui.UpdateLayout();
        }