CEngineSharp_Client.Graphics.MenuScreen.LoadInterface C# (CSharp) Method

LoadInterface() protected method

protected LoadInterface ( ) : void
return void
        protected override void LoadInterface()
        {
            _menuBackground = new Sprite(this.TextureManager.GetTexture("MenuBackground"));

            #region Status Label

            Label labelStatus = this.GUI.Add(new Label(), "labelStatus");
            labelStatus.Position = new Vector2f((Window.Size.X / 2) - (labelStatus.Size.X / 2), 150);
            labelStatus.Visible = false;

            #endregion Status Label

            #region News Label

            Label labelNews = this.GUI.Add(new Label(), "labelNews");
            LoadNews(labelNews);
            labelNews.Position = new Vector2f((Window.Size.X / 2) - (labelNews.Size.X / 2), 200);

            #endregion News Label

            #region Login Button

            Button loginButton = this.GUI.Add(new Button(Constants.FILEPATH_THEME_CONFIG), "buttonLogin");
            loginButton.Position = new Vector2f(100, 500);
            loginButton.Text = "Login";
            loginButton.LeftMouseClickedCallback += buttonLogin_LeftMouseClickedCallback;

            #endregion Login Button

            #region Registration Button

            Button registrationButton = this.GUI.Add(new Button(Constants.FILEPATH_THEME_CONFIG), "buttonRegistration");
            registrationButton.Position = new Vector2f(500, 500);
            registrationButton.Text = "Register";
            registrationButton.LeftMouseClickedCallback += buttonRegistration_LeftMouseClickedCallback;

            #endregion Registration Button

            #region User Label

            Label labelUsername = this.GUI.Add(new Label(), "labelUsername");
            labelUsername.Position = new Vector2f(100, 100);
            labelUsername.Text = "Username: ";
            labelUsername.Visible = false;

            #endregion User Label

            #region Password Label

            Label labelPassword = this.GUI.Add(new Label(), "labelPassword");
            labelPassword.Position = new Vector2f(100, 160);
            labelPassword.Text = "Password: ";
            labelPassword.Visible = false;

            #endregion Password Label

            #region Text User

            EditBox textUser = this.GUI.Add(new EditBox(Constants.FILEPATH_THEME_CONFIG), "textUser");
            textUser.Position = new Vector2f(255, 90);
            textUser.Size = new Vector2f(340, 40);
            textUser.Visible = false;

            #endregion Text User

            #region Text Password

            EditBox textPassword = this.GUI.Add(new EditBox(Constants.FILEPATH_THEME_CONFIG), "textPassword");
            textPassword.Position = new Vector2f(255, 150);
            textPassword.Size = new Vector2f(340, 40);
            textPassword.PasswordCharacter = "*";
            textPassword.Visible = false;

            #endregion Text Password

            #region SendLogin Button

            Button buttonSendLogin = this.GUI.Add(new Button(Constants.FILEPATH_THEME_CONFIG), "buttonSendLogin");
            buttonSendLogin.Position = new Vector2f(300, 250);
            buttonSendLogin.Text = "Login!";
            buttonSendLogin.LeftMouseClickedCallback += buttonSendLogin_LeftMouseClickedCallback;
            buttonSendLogin.Visible = false;

            #endregion SendLogin Button

            #region SendRegistration Button

            Button buttonSendRegistration = this.GUI.Add(new Button(Constants.FILEPATH_THEME_CONFIG), "buttonSendRegistration");
            buttonSendRegistration.Position = new Vector2f(300, 250);
            buttonSendRegistration.Text = "Register!";
            buttonSendRegistration.LeftMouseClickedCallback += buttonSendRegistartion_LeftMouseClickedCallback;
            buttonSendRegistration.Visible = false;

            #endregion SendRegistration Button

            #region Back Button

            Button buttonBack = this.GUI.Add(new Button(Constants.FILEPATH_THEME_CONFIG), "buttonBack");
            buttonBack.Position = new Vector2f(300, 400);
            buttonBack.Visible = false;
            buttonBack.Text = "Back";
            buttonBack.LeftMouseClickedCallback += buttonBack_LeftMouseClickedCallback;

            #endregion Back Button
        }