예제 #1
0
        public override void Initialize(ContentManager Content)
        {
            base.Initialize(Content);

            CreateFramesFromXML("ui/ui_frames");

            CurrentFrame = "levelbutton";
            ResetDimensions();
            UniformScale = 0.8f * ScaleFactor / Camera.Get.UniformWorldScale;

            Colour = new Color(1, 1, 1, 0);

            text = new TextDrawer("ui/LevelFont");
            text.Initialize(Content);
            text.Text = Level.ToString();
            if (!ChicksnVixensGame.Get.LevelUnlocked(location, Level))
            {
                text.Text = "X";

                padLock.Initialize(Content);
                padLock.CreateFramesFromXML("ui/ui_frames");
                padLock.CurrentFrame = "lock";
                padLock.ResetDimensions();
                padLock.UniformScale = ScaleFactor;
            }

            stars = new Sprite("ui/ui");
            stars.Initialize(Content);
            stars.CreateFramesFromXML("ui/ui_frames");
            stars.CurrentFrame = "star";

            stars.ResetDimensions();
            stars.UniformScale = ScaleFactor * 0.3f;
        }
예제 #2
0
 public void SetText(string t, string fontdir)
 {
     text = new TextDrawer(fontdir);
     text.Initialize(BaseGame.Get.Content);
     text.Text = t;
 }
예제 #3
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);
        }
예제 #4
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.Initialize(content);

            BlankNess n = new BlankNess();
            n.Initialize(Content);
            n.RaiseFlag(Jabber.Flags.FADE_IN);
            n.fullBlankity = 0.25f;
            Components.Add(n);

            if (gameplay.GetRemainingFox() == 0)
            {
                MenuObj logo = new MenuObj("ui/ui");
                logo.Initialize(Content);
                logo.CreateFramesFromXML("ui/ui_frames");
                logo.CurrentFrame = "cannonfire";
                logo.ResetDimensions();
                logo.UniformScale = ScaleFactor;
                logo.PosX = 0.1f * BaseGame.Get.BackBufferWidth;

                logo.PosY = 0.1f * BaseGame.Get.BackBufferHeight;
                logo.PosY -= 0.1f * BaseGame.Get.BackBufferHeight;
                logo.Colour = Color.White * 0.5f;
                Components.Add(logo);
            }
            else
            {
                MenuObj logo = new MenuObj("ui/ui");
                logo.Initialize(Content);
                logo.CreateFramesFromXML("ui/ui_frames");
                logo.CurrentFrame = "chickenincannon";
                logo.ResetDimensions();
                logo.UniformScale = ScaleFactor;

                logo.Colour = Color.White * 0.5f;
                logo.PosY -= 0.1f * BaseGame.Get.BackBufferHeight;
                Components.Add(logo);
            }

            ThinBlackLine b = new ThinBlackLine();
            b.Initialize(Content);
            Components.Add(b);

            Button restart = new FadeInButton();
            restart.Initialize(Content);
            restart.CreateFramesFromXML("ui/ui_frames");
            restart.CurrentFrame = "restart";
            restart.ResetDimensions();
            restart.Colour = Color.LightGreen;
            restart.RegularScale = ScaleFactor / 2.0f;
            restart.ScaleOnHover = restart.RegularScale * 1.1f;
            restart.PosY = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
            Components.Add(restart);

            if (gameplay.GetRemainingFox() == 0)
            {
                restart = new FadeInButton();
                restart.Initialize(Content);
                restart.CreateFramesFromXML("ui/ui_frames");
                restart.CurrentFrame = "doublearrow";
                restart.ResetDimensions();
                restart.Colour = Color.LightBlue;
                restart.RegularScale = ScaleFactor / 2.0f;
                restart.ScaleOnHover = restart.RegularScale * 1.1f;
                restart.PosX = BaseGame.Get.BackBufferWidth * 0.14f;
                restart.PosY = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
                Components.Add(restart);
            }

            restart = new FadeInButton();
            restart.Initialize(Content);
            restart.CreateFramesFromXML("ui/ui_frames");
            restart.CurrentFrame = "quit";
            restart.ResetDimensions();
            restart.Colour = Color.Red * 0.8f;
            restart.RegularScale = ScaleFactor / 2.0f;
            restart.ScaleOnHover = restart.RegularScale * 1.1f;
            restart.PosX = -BaseGame.Get.BackBufferWidth * 0.14f;
            restart.PosY = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
            Components.Add(restart);

            TextDrawer text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Best: " + ChicksnVixensGame.Get.GetLevelState(gameplay.location, gameplay.levelNum).Score;
            text.PosX = 0 * BaseGame.Get.BackBufferWidth;
            text.PosY = 0.1f * BaseGame.Get.BackBufferHeight;
            text.UniformScale = ScaleFactor * 0.7f;
            Components.Add(text);

            text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Score: " + gameplay.score.score.ToString();
            text.Colour = Color.OrangeRed;
            text.UniformScale = ScaleFactor;
            text.PosX = 0;
            text.PosY = 0.175f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);

            StarDrawer s = new StarDrawer(gameplay.NumStars);
            s.Initialize(Content);
            Components.Add(s);

            Donut.Initialize(Content);
            Donut.CreateFramesFromXML("misc_frames");
            Donut.CurrentFrame = "donut";
            Donut.ResetDimensions();
            Donut.UniformScale = ScaleFactor;
            Donut.PosY = -0.06f * BaseGame.Get.BackBufferHeight;
            Donut.Colour = Color.White * 0.4f;
            Components.Add(Donut);

            text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Donuts: " + gameplay.donutScore.TargetScore;
            text.Colour = Color.OrangeRed;
            text.UniformScale = ScaleFactor;
            text.PosX = 0;
            text.PosY = -0.025f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);

            text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Best: " + ChicksnVixensGame.Get.GetLevelState(gameplay.location, gameplay.levelNum).NumDonuts;
            text.UniformScale = ScaleFactor * 0.7f;
            text.PosX = 0;
            text.PosY = -0.1f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);
        }
예제 #5
0
        protected override void Draw(GameTime dt)
        {
            if (drawer == null)
            {
                drawer = new TextDrawer("font");
                drawer.Initialize(Content);
            }
            ScreenManager.Get.Draw();
            base.Draw(dt);

            spriteBatch.Begin();
            int milliSeconds = watch.Elapsed.Milliseconds;
            drawer.Text = ((int)(1000.0f / watch.ElapsedMilliseconds)).ToString();
            drawer.Text = ((int)(1000.0f / dt.ElapsedGameTime.Milliseconds)).ToString();
            drawer.DrawIn = BaseSprite.DrawSpace.SCREENSPACE;
            drawer.PosX = 0.1f;
            drawer.PosY = 0.1f;
            //drawer.Draw();
            watch.Stop();
            watch.Reset();
            spriteBatch.End();

            AdSystem.Draw();
        }