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

            MenuObj bg = new MenuObj("ui/mainmenu");
            bg.Initialize(Content);
            bg.CreateFramesFromXML("ui/mainmenu_frames");
            bg.CurrentFrame = "mainmenu";
            bg.ResetDimensions();

            float widthDif = BaseGame.Get.BackBufferWidth / 1000.0f;
            bg.Width *= widthDif;
            bg.Height *= widthDif;
            Components.Add(bg);

            Button b = new Button("ui/ui");
            b.CreateFramesFromXML("ui/ui_frames");
            b.Initialize(Content);
            b.CurrentFrame = "levelbutton";
            b.ResetDimensions();
            b.RegularScale = ScaleFactor * 1.5f;
            b.ScaleOnHover = b.RegularScale * 1.1f;
            b.PosX = -0.24f * BaseGame.Get.BackBufferWidth;
            b.PosY = -0.3f * BaseGame.Get.HalfBackBufferHeight;
            b.SetText("Play", "ui/Play");
            b.Text.Colour = Color.Black;
            b.PlaySFXOnRelease = "Sounds/PlayStateSelect";
            b.TextScaler = 0.75f;
            b.UniformScale = b.RegularScale;
            Components.Add(b);

            b = new Button("ui/ui");
            b.CreateFramesFromXML("ui/ui_frames");
            b.Initialize(Content);
            b.CurrentFrame = "settings";
            b.ResetDimensions();
            b.RegularScale = ScaleFactor * 0.5f;
            b.ScaleOnHover = b.RegularScale * 1.1f;
            b.PosX = -0.45f * BaseGame.Get.BackBufferWidth;
            b.PosY = -0.5f * BaseGame.Get.HalfBackBufferHeight;
            b.UniformScale = b.RegularScale;
            Components.Add(b);

            AudioManager.PlayMusic("troublemaker");

            BlankNess blank = new BlankNess();
            blank.Initialize(Content);
            blank.RaiseFlag(Flags.FADE_OUT);
            blank.fadeInTimer = 1.0f;
            blank.fullBlankity = 1.0f;
            Components.Add(blank);
        }
Exemple #2
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);
        }