コード例 #1
0
        protected override void OnInitialize(object enterInformation)
        {
            base.OnInitialize(enterInformation);

            _panel = new GuiPanel(Game);

            _connectToServerFrame =
                Game.GuiSystem.CreateGuiHierarchyFromXml <GuiElement>("Content/GuiLayouts/NetworkGame_Layout.xml");

            _connectToServerFrame.FindGuiElementById <Button>("ConnectButton").Click += OnConnect;
            _connectToServerFrame.FindGuiElementById <Button>("BackButton").Click    += OnBack;

            _panel.AddElement(_connectToServerFrame);

            _waitDialog          = Game.GuiSystem.CreateGuiHierarchyFromXml <Frame>("Content/GuiLayouts/WaitDialog.xml");
            _waitDialog.IsActive = false;
            _waitDialog.Title    = string.Empty;
            _waitDialog.FindGuiElementById <TextBlock>("MessageText").Text = "Connecting to Server...";
            _panel.AddElement(_waitDialog);

            _errorDialog          = Game.GuiSystem.CreateGuiHierarchyFromXml <Frame>("Content/GuiLayouts/ConfirmationDialog.xml");
            _errorDialog.IsActive = false;
            _errorDialog.Title    = string.Empty;
            _errorDialog.Color    = Color.Red;
            _errorDialog.FindGuiElementById <Button>("ConfirmButton").Click += () =>
            {
                _errorDialog.IsActive          = false;
                _connectToServerFrame.IsActive = true;
            };
            _panel.AddElement(_errorDialog);

            _gameCreationSession = new RemoteGameCreationSession(Game);
        }
コード例 #2
0
        protected override void OnInitialize(object enterInformation)
        {
            base.OnInitialize(enterInformation);

            _currentLevelIndex = 0;
            _levelNames        = GetLocalLevelNames().ToArray();

            _panel = new GuiPanel(Game);

            var frame = Game.GuiSystem.CreateGuiHierarchyFromXml <GuiElement>("Content/GuiLayouts/LocalGameConfig_Layout.xml");

            _panel.AddElement(frame);

            _playerCountTextBlock = frame.FindGuiElementById <TextBlock>("PlayerCountText");
            _comCountTextBlock    = frame.FindGuiElementById <TextBlock>("ComCountText");
            _levelNameTextBlock   = frame.FindGuiElementById <TextBlock>("CurrentLevelText");
            _currentTimeTextBlock = frame.FindGuiElementById <TextBlock>("CurrentTimeText");

            _playerCountTextBlock.Text = _playerCount.ToString(CultureInfo.InvariantCulture);
            _comCountTextBlock.Text    = _comPlayerCount.ToString(CultureInfo.InvariantCulture);
            _levelNameTextBlock.Text   = _levelNames[_currentLevelIndex];
            _currentTimeTextBlock.Text = string.Format("{0:00}:{1:00}", _matchTimeSeconds / 60, _matchTimeSeconds % 60);

            frame.FindGuiElementById <Button>("DecreasePlayerCountButton").Click += () => OnChangePlayerCount(false);
            frame.FindGuiElementById <Button>("IncreasePlayerCountButton").Click += () => OnChangePlayerCount(true);
            frame.FindGuiElementById <Button>("DecreaseComCountButton").Click    += () => OnChangeComCount(false);
            frame.FindGuiElementById <Button>("IncreaseComCountButton").Click    += () => OnChangeComCount(true);
            frame.FindGuiElementById <Button>("PreviousLevelButton").Click       += () => OnChangeLevel(false);
            frame.FindGuiElementById <Button>("NextLevelButton").Click           += () => OnChangeLevel(true);
            frame.FindGuiElementById <Button>("DecreaseTimeButton").Click        += () => OnChangeTime(false);
            frame.FindGuiElementById <Button>("IncreaseTimeButton").Click        += () => OnChangeTime(true);

            frame.FindGuiElementById <Button>("StartGameButton").Click += StartLocalGame;
            frame.FindGuiElementById <Button>("BackButton").Click      += () => { _stateChangeInformation = StateChangeInformation.StateChange(typeof(MainMenuState), typeof(BlendTransition)); };
        }
コード例 #3
0
        protected override void OnInitialize(object enterInformation)
        {
            _panel = new GuiPanel(Game);
            var frame = Game.GuiSystem.CreateGuiHierarchyFromXml <Frame>("GuiSkin\\InputBoxes.xml");

            _panel.AddElement(frame);
        }
コード例 #4
0
        protected override void OnInitialize(object enterInformation)
        {
            _root = new GuiPanel(Game);

            var root = Game.GuiSystem.CreateGuiHierarchyFromXml <GuiElement>("GuiSkin/StartStateLayout.xml");

            _root.AddElement(root);

            SetButtonTransitionTo(root, "StackPanelWithFrameButton", typeof(StackPanelWithFrame));
            SetButtonTransitionTo(root, "GridTestButton", typeof(GridTest));
            SetButtonTransitionTo(root, "TextBoxTestButton", typeof(InputGuiTestState));
            SetButtonTransitionTo(root, "ScrollViewerTestButton", typeof(ScrollViewerState));
        }
コード例 #5
0
        protected override void OnInitialize(object enterInformation)
        {
            base.OnInitialize(enterInformation);

            _panel = new GuiPanel(Game);

            var frame = Game.GuiSystem.CreateGuiHierarchyFromXml <Frame>("Content/GuiLayouts/Credits_Layout.xml");

            frame.FindGuiElementById <Button>("BackButton").Click += () =>
            {
                _stateChangeInformation = StateChangeInformation.StateChange(typeof(MainMenuState),
                                                                             typeof(BlendTransition));
            };

            _panel.AddElement(frame);
        }
コード例 #6
0
 protected override void OnInitialize(object enterInformation)
 {
     _panel = new GuiPanel(Game);
     _frame = Game.GuiSystem.CreateGuiHierarchyFromXml <Frame>("GuiSkin/ScrollViewer.xml");
     _panel.AddElement(_frame);
 }