Example #1
0
        public override void Initialize(ContentManager content)
        {
            base.Initialize(content);

            blank = new BlankNess();
            blank.Initialize(Content);
            blank.RaiseFlag(Flags.FADE_IN);
            blank.fullBlankity = 0.85f;
            blank.fadeSpeed    = 4.0f;
            Components.Add(blank);

            VolumeControl v = new VolumeControl(AudioManager.MusicVolume);

            v.Initialize(Content);
            v.Name          = "MusicVol";
            v.CurrentVolume = AudioManager.MusicVolume;
            v.PosY          = 100.0f * ScaleFactor;
            Components.Add(v);


            TextDrawer text = new TextDrawer("ui/LevelFont");

            text.Initialize(Content);
            text.Text   = "Music Volume";
            text.Colour = Color.Gold;

            if (!AudioManager.IsMusicAllowed)
            {
                text.Text       = "Music Disabled";
                text.Colour     = Color.Red;
                v.Disabled      = true;
                v.CurrentVolume = 0;
            }

            text.Position     = v.Position;
            text.UniformScale = ScaleFactor;
            Components.Add(text);


            v = new VolumeControl(AudioManager.SoundVolume);
            v.Initialize(Content);
            v.Name             = "SoundVol";
            v.CurrentVolume    = AudioManager.SoundVolume;
            v.PosY             = 0 * ScaleFactor;
            v.PlayTickWhenDone = true;
            Components.Add(v);


            text = new TextDrawer("ui/LevelFont");
            text.Initialize(Content);
            text.Text         = "Sound Volume";
            text.Colour       = Color.Gold;
            text.Position     = v.Position;
            text.UniformScale = ScaleFactor;
            Components.Add(text);

            Button back = new Button("ui/ui");

            back.Initialize(Content);
            back.CreateFramesFromXML("ui/ui_frames");
            back.CurrentFrame = "quit";
            back.ResetDimensions();
            back.UniformScale     = ScaleFactor * 0.001f;
            back.RegularScale     = ScaleFactor * 0.5f;
            back.ScaleOnHover     = ScaleFactor * 0.55f;
            back.Colour           = Color.Red;
            back.Effect           = BaseSprite.SpriteEffect.FLIPHORIZONTAL;
            back.PosX             = 0.40f * BaseGame.Get.BackBufferWidth;
            back.PosY             = 0.40f * BaseGame.Get.BackBufferHeight;
            back.PlaySFXOnRelease = "Sounds/PlayStateSelect";
            Components.Add(back);


            arrowToggle = new Button("ui/ui");
            arrowToggle.CreateFramesFromXML("ui/ui_frames");
            arrowToggle.Initialize(Content);
            arrowToggle.CurrentFrame = "levelbutton";
            arrowToggle.ResetDimensions();
            arrowToggle.RegularScale = ScaleFactor * 1.5f;
            arrowToggle.ScaleOnHover = arrowToggle.RegularScale * 1.1f;
            arrowToggle.PosX         = 0 * BaseGame.Get.BackBufferWidth;
            arrowToggle.PosY         = -0.45f * BaseGame.Get.HalfBackBufferHeight;

            if (ChicksnVixensGame.Get.UseTrajectory)
            {
                arrowToggle.SetText("Trajectory", "ui/Play");
            }
            else
            {
                arrowToggle.SetText("Arrow", "ui/Play");
            }

            arrowToggle.Text.Colour      = Color.Black;
            arrowToggle.PlaySFXOnRelease = "Sounds/PlayStateSelect";
            arrowToggle.TextScaler       = 0.65f;
            arrowToggle.UniformScale     = arrowToggle.RegularScale;
            Components.Add(arrowToggle);
        }