コード例 #1
0
ファイル: SettingScreen.cs プロジェクト: NearHuscarl/Breakout
        public SettingScreen()
        {
            Title.Text = "Setting";

            ApplyButton  = WindowFactory.CreateButton("Apply");
            CancelButton = WindowFactory.CreateButton("Cancel");

            ApplyButton.Position = new Vector2()
            {
                X = GetControlXPosition(ApplyButton, 1, 2),
                Y = Position.Y + Height * 0.75f,
            };

            CancelButton.Position = new Vector2()
            {
                X = GetControlXPosition(CancelButton, 2, 2),
                Y = Position.Y + Height * 0.75f,
            };

            SoundText      = WindowFactory.CreateLabel("Sound");
            DifficultyText = WindowFactory.CreateLabel("Difficulty");

            MuteCheckbox = WindowFactory.CreateCheckBox("Mute", AudioManager.IsMute);

            DifficultiesRadioGroup = new RadioGroup(new RadioButton[]
            {
                WindowFactory.CreateRadioButton("Easy", GlobalData.Settings.Difficulty == Difficulty.Easy),
                WindowFactory.CreateRadioButton("Normal", GlobalData.Settings.Difficulty == Difficulty.Normal),
                WindowFactory.CreateRadioButton("Hard", GlobalData.Settings.Difficulty == Difficulty.Hard),
            });

            SoundText.Position      = new Vector2(Position.X + 100f, Position.Y + 70f);
            DifficultyText.Position = new Vector2(Position.X + 100f, Position.Y + 140f);

            MuteCheckbox.Position = new Vector2(Position.X + 200f, Position.Y + 60f);

            DifficultiesRadioGroup.RadioButtons[0].Position = new Vector2(Position.X + 200f, Position.Y + 130f);
            DifficultiesRadioGroup.RadioButtons[1].Position = new Vector2(Position.X + 200f, Position.Y + 180f);
            DifficultiesRadioGroup.RadioButtons[2].Position = new Vector2(Position.X + 200f, Position.Y + 230f);
        }