Пример #1
0
        protected override void LoadContent()
        {
            base.LoadContent();

            // init room name label

            roomNameLabel = new DText(guiManager);
            roomNameLabel.FontName = "Miramonte";
            layout.Add(roomNameLabel);
            roomNameLabel.Initialize();
            roomNameLabel.Text = "Room Name:";
            roomNameLabel.Position = new Vector2(400, 100) - (roomNameLabel.Size / 2);
            roomNameLabel.HorizontalAlignment = DText.DHorizontalAlignment.Center;
            form.AddPanel(roomNameLabel);

            // init room name textbox
            roomNameTextBox = new DTextBox(guiManager);
            layout.Add(roomNameTextBox);
            roomNameTextBox.Initialize();
            roomNameTextBox.Text = "asdasd";
            roomNameTextBox.Position = new Vector2(400, 150) - (roomNameTextBox.Size / 2);
            form.AddPanel(roomNameTextBox);

            // init max players label
            maxPlayerLabel = new DText(guiManager);
            maxPlayerLabel.FontName = "Miramonte";
            layout.Add(maxPlayerLabel);
            maxPlayerLabel.Initialize();
            maxPlayerLabel.Text = "Max Players:";
            maxPlayerLabel.Position = new Vector2(400, 200) - (maxPlayerLabel.Size / 2);
            maxPlayerLabel.HorizontalAlignment = DText.DHorizontalAlignment.Center;
            form.AddPanel(maxPlayerLabel);

            // init max player textbox
            maxPlayerTextBox = new DTextBox(guiManager);
            layout.Add(maxPlayerTextBox);
            maxPlayerTextBox.Initialize();
            maxPlayerTextBox.Text = "8";
            maxPlayerTextBox.Position = new Vector2(400, 250) - (maxPlayerTextBox.Size / 2);
            form.AddPanel(maxPlayerTextBox);

            // init cancel button
            cancelButton = new DButton(guiManager);
            layout.Add(cancelButton);
            cancelButton.Text = "Cancel";
            cancelButton.Position = new Vector2(cancelButton.Size.X + 200, 400) - cancelButton.Size;
            cancelButton.Initialize();
            form.AddPanel(cancelButton);
            cancelButton.OnClick += new DButtonEventHandler(cancelButton_OnClick);

            // init create button
            createRoomButton = new DButton(guiManager);
            layout.Add(createRoomButton);
            createRoomButton.Text = "Create";
            createRoomButton.Position = new Vector2(600, 400) - createRoomButton.Size;
            createRoomButton.Initialize();
            form.AddPanel(createRoomButton);
            createRoomButton.OnClick += new DButtonEventHandler(createRoomButton_OnClick);
        }
Пример #2
0
        protected override void LoadContent()
        {
            base.LoadContent();

            // init gundbound label

            gundboundLabel = new DText(guiManager);
            gundboundLabel.FontName = "Miramonte";
            layout.Add(gundboundLabel);
            gundboundLabel.Initialize();
            gundboundLabel.Text = "Gunbound";
            gundboundLabel.Position = new Vector2(400, 200) - (gundboundLabel.Size / 2);
            gundboundLabel.HorizontalAlignment = DText.DHorizontalAlignment.Center;
            form.AddPanel(gundboundLabel);

            // init ip address textbox
            ipAddressTextBox = new DTextBox(guiManager);
            layout.Add(ipAddressTextBox);
            ipAddressTextBox.Initialize();
            ipAddressTextBox.Text = "127.0.0.1";
            ipAddressTextBox.Position = new Vector2(400, 250) - (ipAddressTextBox.Size / 2);
            form.AddPanel(ipAddressTextBox);

            // init username textbox
            usernameTextBox = new DTextBox(guiManager);
            layout.Add(usernameTextBox);
            usernameTextBox.Initialize();
            usernameTextBox.Text = "username";
            usernameTextBox.Position = new Vector2(400, 300) - (usernameTextBox.Size / 2);
            form.AddPanel(usernameTextBox);

            // init handshake button
            handshakeButton = new DButton(guiManager);
            layout.Add(handshakeButton);
            handshakeButton.Text = "Connect";
            handshakeButton.Position = new Vector2(400, 350) - (handshakeButton.Size / 2);
            handshakeButton.Initialize();
            form.AddPanel(handshakeButton);
            handshakeButton.OnClick += new DButtonEventHandler(handshakeButton_OnClick);
        }