Example #1
0
        public CommandInfoBar(Session s, Rectangle r, GraphicsDevice gd)
        {
            Session = s;
            Session.TowerPurchased += new TDA3Engine.Session.PurhcaseTowerEventHandler(Session_TowerPurchased);
            Session.MoneyIncreased += new EventHandler(Session_MoneyIncreased);
            background = Session.Map.InfoBarBackground;
            Rectangle = r;
            padding = 10;
            waveindex = Session.Map.WaveIndex;

            MoneyAndTowers = new UIBlock(gd, null, s.Map.BorderColor, new Rectangle(r.X, r.Y, r.Width - 5, 50), s);
            PurchaseTower = new UIBlock(gd, s.Map.BorderTexture, s.Map.BorderColor, new Rectangle(r.X, MoneyAndTowers.Dimensions.Bottom + 10, r.Width - 5, 420), s);
            SelectedTower = new UIBlock(gd, s.Map.BorderTexture, s.Map.BorderColor, new Rectangle(r.X, MoneyAndTowers.Dimensions.Bottom + 10, r.Width - 5, 420), s);
            StatsAndControls = new UIBlock(gd, s.Map.BorderTexture, s.Map.BorderColor, new Rectangle(r.X, PurchaseTower.Dimensions.Bottom + 10, r.Width - 5, 200), s);
            TablasMultiplicar = new UIBlock(gd, null, s.Map.BorderColor, new Rectangle(r.X, r.Y, r.Width - 5, 50), s);
            SelectTablas = new UIBlock(gd, null, s.Map.BorderColor, new Rectangle(r.X, r.Y, r.Width - 5, 300), s);

            s.HealthDecreased += new EventHandler(s_HealthDecreased);
        }
Example #2
0
        public override void LoadContent()
        {
            ContentManager content = ScreenSystem.Content;
            font = content.Load<SpriteFont>(@"Fonts/menu");
            smallfont = content.Load<SpriteFont>(@"Fonts/menusmall");

            inactiveButtonTexture = content.Load<Texture2D>("Textures\\Menu\\inactivebutton");
            activeButtonTexture = content.Load<Texture2D>("Textures\\Menu\\activebutton");

            Selected = new Color(214, 232, 223);
            Normal = new Color(104, 173, 178);

            mouse = new Mouse(content.Load<Texture2D>("Textures\\menu\\mouse"));

            musicBlock = new UIBlock(ScreenSystem.GraphicsDevice, new Rectangle(10, 110, ScreenSystem.Viewport.Width - 10, 100), Color.White);
            soundBlock = new UIBlock(ScreenSystem.GraphicsDevice, new Rectangle(10, 220, ScreenSystem.Viewport.Width - 10, 100), Color.White);

            Vector2 pos = new Vector2((int)(musicBlock.Dimensions.Left + inactiveButtonTexture.Width), (int)(musicBlock.Dimensions.Top + inactiveButtonTexture.Height));
            Button b = new Button(inactiveButtonTexture, pos,
                new Text(String.Format("Music:{0}%", (int)(Settings.MusicVolume * 100)), font, new Vector2(pos.X - (inactiveButtonTexture.Width / 2) + 10, pos.Y - (inactiveButtonTexture.Height / 2))), Normal, this);
            b.LeftClickEvent += new EventHandler(music_LeftClickEvent);
            musicBlock.Add("MusicButton", b);

            Text minstructions = new Text("Select the Music button to change settings", smallfont, new Vector2(b.Position.X + (b.Texture.Width / 2) + 10, b.ButtonText.Position.Y));
            musicBlock.Add("MusicInstructions", minstructions);

            pos = new Vector2((int)(soundBlock.Dimensions.Left + inactiveButtonTexture.Width), (int)(soundBlock.Dimensions.Top + inactiveButtonTexture.Height));
            b = new Button(inactiveButtonTexture, pos,
                new Text(String.Format("Sound:{0}%", (int)(Settings.SoundVolume * 100)), font, new Vector2(pos.X - (inactiveButtonTexture.Width / 2) + 10, pos.Y - (inactiveButtonTexture.Height / 2))), Normal, this);
            b.LeftClickEvent += new EventHandler(sound_LeftClickEvent);
            soundBlock.Add("SoundButton", b);

            minstructions = new Text("Select the Sound button to change settings", smallfont, new Vector2(b.Position.X + (b.Texture.Width / 2) + 10, b.ButtonText.Position.Y));
            soundBlock.Add("SoundInstructions", minstructions);

            backmessage = "Press Escape to go back";
        }