コード例 #1
0
ファイル: AudioManager.cs プロジェクト: DonkerNet/pong
        // Keep track of changes made to the audio settings
        private void OnSettingsApplied(object sender, SettingsAppliedEventArgs e)
        {
            if (!e.AudioChanged)
            {
                return;
            }

            _enabled = _settings.Settings.Audio.Enabled;
            _volume  = _settings.Settings.Audio.Volume / 100F;
            _sfxSet  = _settings.Settings.Audio.SfxSet;
        }
コード例 #2
0
ファイル: MainGame.cs プロジェクト: DonkerNet/pong
        private void SettingsManagerOnSettingsApplied(object sender, SettingsAppliedEventArgs e)
        {
            // Update the bounds and scale when video settings are altered
            if (e.VideoChanged)
            {
                Vector2 resolution = _settingsManager.Settings.Video.Resolution;

                float boundsWidth = (resolution.X / resolution.Y) * _gameInfo.Bounds.Height;
                _gameInfo.Bounds = new RectangleF(0F, 0F, boundsWidth, _gameInfo.Bounds.Height);

                _gameInfo.Scale = resolution.Y / _gameInfo.Bounds.Height;
            }
        }