Ejemplo n.º 1
0
        protected override void OnStart()
        {
            _background = Content.Load <Texture2D>("Textures/Background");

            _menu               = new TextMenu(AppContents.DefaultFont);
            _menu.ItemHovered  += (item) => { _soundsManager.PlaySound(SoundName.Blip5); };
            _menu.Pos           = new Vector2(100, 150);
            _menu.Padding       = AppConstants.MenuPadding;
            _menu.Color         = AppColors.MenuItems;
            _menu.ColorDisabled = AppColors.MenuItemsDisabled;
            _menu.ColorHover    = AppColors.MenuItemsHover;

            var itemNew = _menu.CreateItem("New game");

            itemNew.Clicked += ItemNew_Clicked;

            var itemContinueLast = _menu.CreateItem("Continue");

            itemContinueLast.Clicked += ItemContinueLast_Clicked;

            var itemHighscore = _menu.CreateItem("Highscores");

            itemHighscore.Clicked += ItemHighscore_Clicked;
            itemHighscore.Margin   = new Padding(0, 15, 0, 0);

            var itemSettings = _menu.CreateItem("Settings");

            itemSettings.Clicked += ItemSettings_Clicked;
            itemSettings.Margin   = new Padding(0, 15, 0, 0);

            var itemEnd = _menu.CreateItem("Exit");

            itemEnd.Margin   = new Padding(0, 45, 0, 0);
            itemEnd.Clicked += ItemEnd_Clicked;
        }
Ejemplo n.º 2
0
        private void ChangeVolume(int offset)
        {
            int newValue = MathI.Clamp(_sounds.Volume + offset, 0, 100);

            if (_sounds.Volume != newValue)
            {
                _sounds.Volume = (byte)newValue;
                _sounds.PlaySound(SoundName.Blip5);

                _settings.Settings.Audio.EffectsVolume = _sounds.Volume;

                RefreshVolumeLabel();
            }
        }
Ejemplo n.º 3
0
        protected override void OnStart()
        {
            _menu               = new TextMenu(AppContents.DefaultFont);
            _menu.ItemHovered  += (item) => { _soundsManager.PlaySound(SoundName.Blip5); };
            _menu.Pos           = new Vector2(100, 150);
            _menu.Padding       = AppConstants.MenuPadding;
            _menu.Color         = AppColors.MenuItems;
            _menu.ColorDisabled = AppColors.MenuItemsDisabled;
            _menu.ColorHover    = AppColors.MenuItemsHover;

            var itemContinue = _menu.CreateItem("Continue", "ContinueGame");

            itemContinue.Clicked += ItemContinue_Clicked;

            var itemCancel = _menu.CreateItem("Cancel", "Cancel");

            itemCancel.Clicked += ItemCancel_Clicked;

            var itemEnd = _menu.CreateItem("Exit");

            itemEnd.Margin   = new Padding(0, 25, 0, 0);
            itemEnd.Clicked += ItemEnd_Clicked;
        }