예제 #1
0
        public override void LoadContent()
        {
            username = new InputBox();
            host     = new InputBox();
            connect  = new Button();
            back     = new Button();

            connect.Text = "Connect";
            back.Text    = "Back";

            connect.Click += HandleClicks;
            back.Click    += HandleClicks;

            username.Hint = "Username";
            host.Hint     = "Host's IP Address";

            username.Position = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 - 64);
            host.Position     = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 - 16);
            connect.Position  = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 + 32);
            back.Position     = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 + 96);

            compManager.AddComponent(username);
            compManager.AddComponent(host);
            compManager.AddComponent(connect);
            compManager.AddComponent(back);

            compManager.ClearFocuses();
        }