Пример #1
0
        private void SetupUsernameMenu()
        {
            UsernameLabel = new Gwen.Control.Label(BaseCanvas);
            UsernameLabel.SetText("Enter Desired Username" +
                                  "\n(This is how your score will be represented in the Highscores page.)" +
                                  "\n(Name must be between 1 and 16 characters, and be ASCII encodable.(0-9, a-Z))");
            UsernameLabel.AutoSizeToContents = true;
            UsernameLabel.SetPosition(300, 150);

            UsernameBox = new Gwen.Control.TextBox(BaseCanvas);
            UsernameBox.SetSize(180, 35);
            UsernameBox.SetPosition(300, 200);

            UsernameContinue = new Gwen.Control.Button(BaseCanvas);
            UsernameContinue.SetText("Continue");
            UsernameContinue.SetSize(150, 30);
            UsernameContinue.SetPosition(300, 260);
            UsernameContinue.Clicked += (B, Args) =>
            {
                if (UsernameBox.Text != "" && UsernameBox.Text.Length <= 16)
                {
                    ActiveScreen = Screen.Menu;
                }
            };
        }
Пример #2
0
        public void SetupRemote(World RemoteWorldInst)
        {
            this.RemoteWorldInst = RemoteWorldInst;

            RemoteSizeBox           = new Gwen.Control.TextBox(BaseCanvas);
            RemoteSizeBox.TextColor = Color.Black;
            RemoteSizeBox.SetPosition(Columns * ColumnWidth + 50, Rows * RowHeight);
        }
Пример #3
0
        public void SetupNetworkedSessionMenu()
        {
            ServerSelectorLabel = new Gwen.Control.Label(BaseCanvas);
            ServerSelectorLabel.SetText("Server");
            ServerSelectorLabel.AutoSizeToContents = true;
            ServerSelectorLabel.SetPosition(50, 0);

            ServerSelector = new Gwen.Control.ComboBox(BaseCanvas);
            ServerSelector.AddItem("Server A");
            ServerSelector.AddItem("Server B");
            ServerSelector.AddItem("Server C");
            ServerSelector.AddItem("Server D");
            ServerSelector.AddItem("Server E");
            ServerSelector.AddItem("Server F");
            ServerSelector.AddItem("Server G");
            ServerSelector.AddItem("Server H");
            ServerSelector.AddItem("Server I");
            ServerSelector.AddItem("Server J");
            ServerSelector.AddItem("Custom Server...");
            ServerSelector.SetSize(200, 50);
            ServerSelector.SetPosition(50, 20);
            ServerSelector.TextColor = Color.Black;
            ServerSelector.UpdateColors();

            CustomServerLabel = new Gwen.Control.Label(BaseCanvas);
            CustomServerLabel.SetText("Address                                           Port");
            CustomServerLabel.AutoSizeToContents = true;
            CustomServerLabel.SetPosition(50, 180);

            CustomServerAddress = new Gwen.Control.TextBox(BaseCanvas);
            CustomServerAddress.SetSize(200, 30);
            CustomServerAddress.SetPosition(50, 200);

            CustomServerPort = new Gwen.Control.TextBox(BaseCanvas);
            CustomServerPort.SetSize(70, 30);
            CustomServerPort.SetPosition(254, 200);

            SessionConnect = new Gwen.Control.Button(BaseCanvas);
            SessionConnect.SetText("Connect");
            SessionConnect.SetSize(200, 50);
            SessionConnect.SetPosition(260, 380);
            SessionConnect.Clicked += (B, Args) =>
            {
                ActiveScreen = Screen.Connecting;
            };

            BackButton = new Gwen.Control.Button(BaseCanvas);
            BackButton.SetText("Back");
            BackButton.AutoSizeToContents = true;
            BackButton.SetPosition(50, 450);
            BackButton.Clicked += (B, Args) =>
            {
                ActiveScreen = Screen.Menu;
            };
        }
Пример #4
0
        public void SetupLocal(World LocalWorldInst, Snake LocalSnakeInst)
        {
            this.LocalWorldInst = LocalWorldInst;
            this.LocalSnakeInst = LocalSnakeInst;

            LocalSizeBox           = new Gwen.Control.TextBox(BaseCanvas);
            LocalSizeBox.TextColor = Color.Black;
            LocalSizeBox.SetPosition(0, Rows * RowHeight);

            ReturnToMenuButton = new Gwen.Control.Button(BaseCanvas);
            ReturnToMenuButton.SetText("Return to Menu");
            ReturnToMenuButton.AutoSizeToContents = true;
            ReturnToMenuButton.SetPosition(0, Rows * RowHeight + 60);
            ReturnToMenuButton.Clicked += (B, Args) =>
            {
                ActiveScreen = Screen.Menu;

                SessionLeaveCallback();
            };
        }
Пример #5
0
 public static void Init()
 {
     Gwen.Control.TabButton button = tabControl.AddPage("Console");
     tabControl.Padding = new Padding(2, 2, 2, 2);
     Gwen.Control.Base page = button.Page;
     {
         consoleInput = new Gwen.Control.TextBox(page);
         consoleInput.SetBounds(0, 87, tabControl.Width - 17, 25);
         consoleOutput = new Gwen.Control.ListBox(page);
         consoleOutput.SetBounds(0, 0, tabControl.Width - 17, tabControl.Height - 65);
         consoleOutput.Disable();
         consoleOutput.AddRow("Type \"help\" for a list of commands.");
     }
 }