Beispiel #1
0
        public Menu()
        {
            background        = new Texture(Resources.menu_bg);
            background.Smooth = true;

            Music = new SliderInput(Settings.sWidth - 50 - Settings.sWidth / 4, Settings.sHeight - 400 - 25, 30, Settings.sWidth / 4, false);

            SFX            = new SliderInput(Settings.sWidth - 50 - Settings.sWidth / 4, Settings.sHeight - 500 - 25, 30, Settings.sWidth / 4, false);
            Music.onChange = MusicVolumeChange;
            SFX.onChange   = SFXVolumeChange;
            Music.SetText("Музыка");
            SFX.SetText("Звуки");


            textBox = new TextBox(
                new Vector2f(Settings.sWidth / 2, Settings.sHalfHeight),
                new Vector2f(300, 30),
                "Тест",
                new Font(Resources.MenuFont)
                )
            {
                BackgroundColor = Color.White,
                OutlineColor    = Color.Blue
            };
        }
Beispiel #2
0
        private void SettingsOnClick()
        {
            start.SetSpeed(new Vector2f(-6, 0));
            start.SetDestinationPoint(new Vector2f(-200, 50));
            start.StartAnimation();

            load.SetSpeed(new Vector2f(-5, 0));
            load.SetDestinationPoint(new Vector2f(-200, 50));
            load.StartAnimation();

            newgame.SetSpeed(new Vector2f(-4, 0));
            newgame.SetDestinationPoint(new Vector2f(-200, 50));
            newgame.StartAnimation();

            settings.SetSpeed(new Vector2f(-3, 0));
            settings.SetDestinationPoint(new Vector2f(-200, 50));
            settings.StartAnimation();

            exit.SetSpeed(new Vector2f(-2, 0));
            exit.SetDestinationPoint(new Vector2f(-200, 50));
            exit.StartAnimation();

            Aliasing.Enabled     = true;
            FPSLimit.Enabled     = true;
            VSynh.Enabled        = true;
            ExitSettings.Enabled = true;
            Resolution.Enabled   = true;

            var temp = Music.Progress;

            Music          = new SliderInput(Settings.sWidth - 50 - Settings.sWidth / 4, Settings.sHeight - 400 - 25, 30, Settings.sWidth / 4, false);
            Music.Progress = temp;

            temp         = SFX.Progress;
            SFX          = new SliderInput(Settings.sWidth - 50 - Settings.sWidth / 4, Settings.sHeight - 500 - 25, 30, Settings.sWidth / 4, false);
            SFX.Progress = temp;

            Music.onChange = MusicVolumeChange;
            SFX.onChange   = SFXVolumeChange;
            Music.SetText("Музыка");
            SFX.SetText("Звуки");

            Music.Active = true;
            SFX.Active   = true;

            SettingsMenu();
        }