Exemplo n.º 1
0
        public SetupLocal(GraphicsDevice device) : base(device, "setuplocal")
        {
            nameField = new TextField("Name", device.Viewport.Width / 2 - 100, device.Viewport.Height / 3, 150, 50);
            botsField = new TextField("3", device.Viewport.Width / 2 - 100, (device.Viewport.Height / 3) + 100, 150, 50);
            Button startButton = new Button("Start", device.Viewport.Width / 2 - 100, (device.Viewport.Height / 3) + 200, 150, 50);

            startButton.AddButtonListener(this);
            AddTextField(nameField);
            AddTextField(botsField);
            AddButton(startButton);
        }
Exemplo n.º 2
0
        public Menu(GraphicsDevice device) : base(device, "menu")
        {
            Button local = new Button("Local", device.Viewport.Width / 2 - 100, device.Viewport.Height / 2, 150, 50);

            local.AddButtonListener(this);
            AddButton(local);
            Button network = new Button("Network", device.Viewport.Width / 2 - 100, (device.Viewport.Height / 2) + 100, 150, 50);

            network.AddButtonListener(this);
            AddButton(network);
            errorText = new Label("", 0, device.Viewport.Height - 25, Color.Red, Configuration.ButtonFont);
            AddLabel(errorText);
        }
Exemplo n.º 3
0
        public SetupMultiplayer(GraphicsDevice device) : base(device, "setupmultiplayer")
        {
            nameField         = new TextField("Name", device.Viewport.Width / 2 - 100, device.Viewport.Height / 3, 150, 50);
            ipField           = new TextField("127.0.0.1", device.Viewport.Width / 2 - 100, (device.Viewport.Height / 3) + 100, 150, 50);
            ipField.MaxLength = 20;
            portField         = new TextField("7772", device.Viewport.Width / 2 - 100, (device.Viewport.Height / 3) + 200, 150, 50);
            Button startButton = new Button("Start", device.Viewport.Width / 2 - 100, (device.Viewport.Height / 3) + 300, 150, 50);

            startButton.AddButtonListener(this);
            AddTextField(nameField);
            AddTextField(ipField);
            AddTextField(portField);
            AddButton(startButton);
        }