예제 #1
0
 protected override void OnInit()
 {
     Audio.PlayMusic("MainTheme", 1);
     CurrentGameState.Reset();
     Add(UiButtons.Menu("Start Game", new Vector2(colX, Height(0)), () => Scene.NavigateTo(GameResources.PickNameSceneName)));
     Add(UiButtons.Menu("Continue Game", new Vector2(colX, Height(1)), () => Scene.NavigateTo(GameResources.SaveLoadSceneName)));
     Add(UiButtons.Menu("Credits", new Vector2(colX, Height(2)), () => Scene.NavigateTo(GameResources.CreditsSceneName)));
     Add(UiButtons.Menu("Options", new Vector2(colX, Height(3)), () => Scene.NavigateTo(GameResources.OptionsSceneName)));
     Add(UiButtons.Menu("Exit Game", new Vector2(colX, Height(4)), () => CurrentGame.TheGame.Exit()));
 }
예제 #2
0
 public void Init()
 {
     _clickUI = new ClickUI();
     _credits = UiButtons.Menu("Credits", new Vector2(UI.OfScreenWidth(0.5f) - 180, 900), () => Scene.NavigateTo(GameResources.CreditsSceneName));
     _chatBox = new ChatBox("", 1670, DefaultFont.Value, CurrentOptions.MillisPerTextCharacter, 32)
     {
         SoundsEnabled = false
     };
     _clickUI.Add(_credits);
     _clickUI.Add(new ScreenClickable(_chatBox.CompletelyDisplayMessage));
     CalculateLinchPins();
     GenerateWallOfText();
 }
예제 #3
0
        private void AddGameplayOptions()
        {
            var colX = XPos(0.25f);

            Add(UiLabels.Option("Gameplay", new Vector2(colX, Height(0))));
            Add(UiButtons.Menu("Text: Slow", new Vector2(colX, Height(1)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter    = 45)));
            Add(UiButtons.Menu("Text: Normal", new Vector2(colX, Height(2)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter  = 30)));
            Add(UiButtons.Menu("Text: Fast", new Vector2(colX, Height(3)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter    = 15)));
            Add(UiButtons.Menu("Text: Instant", new Vector2(colX, Height(4)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter = 0)));

            _tutorialsToggle = UiButtons.Menu(GetTutorialText(), new Vector2(colX, Height(6)), ToggleTutorials);
            Add(_tutorialsToggle);
        }
예제 #4
0
        private void AddResetControls()
        {
            var rowY = UI.OfScreenHeight(0.8f);

            Add(UiLabels.Option("Resets", new Vector2(XPos(0.5f), Height(0, rowY))));
            Add(UiButtons.Menu("Reset Options", new Vector2(XPos(0.50f), Height(1, rowY)), () =>
            {
                CurrentOptions.UpdateDisplay(x => CurrentOptions.Reset());
                _tutorialsToggle.Text = GetTutorialText();
                _soundVolume.Text     = GetSoundVolumeText();
                _musicVolume.Text     = GetMusicVolumeText();
            }));
        }
예제 #5
0
        private void AddDisplayOptions()
        {
            var colX = XPos(0.50f);

            Add(UiLabels.Option("Display", new Vector2(colX, Height(0))));
            Add(UiButtons.Menu("Toggle FullScreen", new Vector2(colX, Height(1)), () => CurrentOptions.UpdateDisplay(x => x.IsFullscreen = !x.IsFullscreen)));

            Add(UiButtons.Menu("960x540", new Vector2(colX, Height(3)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 0.5f),
                               () => !CurrentOptions.IsFullscreen));
            Add(UiButtons.Menu("1440x810", new Vector2(colX, Height(4)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 0.75f),
                               () => !CurrentOptions.IsFullscreen));
            Add(UiButtons.Menu("1920x1080", new Vector2(colX, Height(5)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 1),
                               () => !CurrentOptions.IsFullscreen));
        }
예제 #6
0
        protected override void OnInit()
        {
            _playerCharacter = new PlayerCharacterView(() => true);
            var header = UiLabels.FullWidthHeaderLabel("New Game", Color.White);

            header.Transform.Location = new Vector2(header.Transform.Location.X, 158);
            Add(header);

            _keyboard = new KeyboardTyping(GameResources.DefaultPlayerCharacterName);
            Add(_keyboard);
            var yStart = 331;

            Add(new Label {
                Text = "Character Name", Transform = new Transform2(new Vector2(758, yStart), new Size2(400, 50))
            });
            Add(new ColoredRectangle {
                Color = Color.FromNonPremultiplied(31, 185, 219, 199), Transform = new Transform2(new Vector2(758, yStart + 60 - 2), new Size2(404, 79))
            });
            _textboxLabel = new Label {
                Text = GameResources.DefaultPlayerCharacterName, Transform = new Transform2(new Vector2(760, yStart + 60), new Size2(400, 75)), BackgroundColor = Color.FromNonPremultiplied(25, 75, 110, 255)
            };
            Add(_textboxLabel);

            yStart = 541;
            Add(new Label {
                Text = "Difficulty", Transform = new Transform2(new Vector2(860, yStart), new Size2(200, 50))
            });
            Add(new ColoredRectangle {
                Color = Color.FromNonPremultiplied(31, 185, 219, 199), Transform = new Transform2(new Vector2(758, yStart + 60 - 2), new Size2(404, 79))
            });
            _shouldGuideLabel = new Label {
                Text = "Guide Me a Little", Transform = new Transform2(new Vector2(760, yStart + 60), new Size2(400, 75)), BackgroundColor = Color.FromNonPremultiplied(25, 75, 110, 255)
            };
            Add(_shouldGuideLabel);
            Add(UiButtons.MenuSmallBlue("Guide Me", new Vector2(700, yStart + 170), () =>
            {
                CurrentGameState.ShowObjectives = true;
                _shouldGuideLabel.Text          = "Guide Me a Little";
            }));
            Add(UiButtons.MenuSmallBlue("I'm A Pro", new Vector2(980, yStart + 170), () =>
            {
                CurrentGameState.ShowObjectives = false;
                _shouldGuideLabel.Text          = "I Know What I'm Doing";
            }));

            Input.On(Control.Start, StartGame);
            Add(UiButtons.Menu("Begin", new Vector2(780, 900), StartGame));
        }