Exemplo n.º 1
0
        protected override void LoadContent()
        {
            base.LoadContent();
            ContentManager Content = Game.Content;

            Background = new PictureBox(
                Content.Load<Texture2D>(@"Backgrounds\GameOverScreen"),
                GameRef.ScreenRectangle);
            ControlManager.Add(Background);

            Texture2D arrow = Content.Load<Texture2D>(@"GUI\leftarrowUp");

            ArrowTexture = new PictureBox(
                arrow,
                new Rectangle(0, 0, arrow.Width, arrow.Height));
            ControlManager.Add(ArrowTexture);

            StartOver = new LinkLabel();
            StartOver.Text = "Start the game Over";
            StartOver.Size = StartOver.SpriteFont.MeasureString(StartOver.Text);
            StartOver.Selected += new EventHandler(StartOver_Selected);
            ControlManager.Add(StartOver);

            Quit = new LinkLabel();
            Quit.Text = "Quit the game";
            Quit.Size = Quit.SpriteFont.MeasureString(Quit.Text);
            Quit.Selected += new EventHandler(Quit_Selected);
            ControlManager.Add(Quit);

            ControlManager.NextControl();
            ControlManager.FocusedChanged += new EventHandler(ControlManager_FocusedChanged);

            Vector2 position = new Vector2(((GameRef.ScreenRectangle.Width / 2) - StartOver.Size.X),
                 GameRef.ScreenRectangle.Height / 2);

            foreach (Control c in ControlManager)
            {
                if (c is LinkLabel)
                {
                    c.Position = position;
                    position.Y += c.Size.Y + 5f;
                }
            }

            ControlManager_FocusedChanged(StartOver, null);
        }
Exemplo n.º 2
0
        protected override void LoadContent()
        {
            base.LoadContent();

            ContentManager content = Game.Content;

            Background = new PictureBox(GameRef.Content.Load<Texture2D>(@"Backgrounds\MenuBackground"), GameRef.ScreenRectangle);
            ControlManager.Add(Background);

            gold = new Label();
            gold.Text = "Gold:  " + player.Money;
            gold.Position = new Vector2(400, 0);

            title = new Label();
            title.Text = " BulkShop";

            item1 = new LinkLabel();
            item2 = new LinkLabel();

            ControlManager.Add(title);
            ControlManager.Add(gold);
            Vector2 pos = new Vector2(10, 120);
            populateLabels(pos);

            ControlManager.NextControl();
        }
Exemplo n.º 3
0
        protected override void LoadContent()
        {
            base.LoadContent();
            ContentManager Content = Game.Content;

            Background = new PictureBox(
                Content.Load<Texture2D>(@"Backgrounds\spacewizardstitle"),
                GameRef.ScreenRectangle);
            ControlManager.Add(Background);

            Texture2D arrowTexture = Content.Load<Texture2D>(@"GUI\leftarrowUp");

            arrow = new PictureBox(
                arrowTexture,
                new Rectangle(0, 0, arrowTexture.Width, arrowTexture.Height));
            ControlManager.Add(arrow);

            start = new LinkLabel();
            start.Text = "Start Game";
            start.Size = start.SpriteFont.MeasureString(start.Text);
            start.Selected += new EventHandler(menu_Selected);
            ControlManager.Add(start);

            load = new LinkLabel();
            load.Text = "Load Game";
            load.Size = load.SpriteFont.MeasureString(load.Text);
            load.Selected += menu_Selected;

            exit = new LinkLabel();
            exit.Text = "Quit Game";
            exit.Size = exit.SpriteFont.MeasureString(exit.Text);
            exit.Selected += menu_Selected;
            ControlManager.Add(exit);

            ControlManager.NextControl();

            ControlManager.FocusedChanged += new EventHandler(ControlManager_FocusedChanged);
            Vector2 position = new Vector2(375, 500);

            foreach (Control c in ControlManager)
            {
                if (c is LinkLabel)
                {
                    if (c.Size.X > maxItemWidth)
                        maxItemWidth = c.Size.X;

                    c.Position = position;
                    position.Y += c.Size.Y + 5f;

                }
            }
            ControlManager_FocusedChanged(start, null);
        }
Exemplo n.º 4
0
        protected override void LoadContent()
        {
            base.LoadContent();
            ContentManager Content = Game.Content;

            textSprite = Game.Content.Load<Texture2D>(@"Images/textBox");
            font = Game.Content.Load<SpriteFont>(@"Fonts/ControlFont");

            Background = new PictureBox(
                Content.Load<Texture2D>(@"Backgrounds\CombatBackground"),
                GameRef.ScreenRectangle);
            ControlManager.Add(Background);

            Texture2D arrow = Content.Load<Texture2D>(@"GUI\leftarrowUp");

            ArrowTexture = new PictureBox(
                arrow,
                new Rectangle(0, 0, arrow.Width, arrow.Height));
            ControlManager.Add(ArrowTexture);

            enemyBackground = new PictureBox(
                Enemies[0].image,
                new Rectangle(250, 250,
                    Enemies[0].image.Width * 3, Enemies[0].image.Height * 3));
            ControlManager.Add(enemyBackground);

            EnemyName = new Label();
            EnemyName.Text = Enemies[0].name;
            EnemyName.Position = new Vector2(250, 220);
            ControlManager.Add(EnemyName);

            EnemyHealthLabel = new Label();
            EnemyHealthLabel.Text = "Health:";
            EnemyHealthLabel.Position = new Vector2(250, 440);
            EnemyHealthLabel.Size = EnemyHealthLabel.SpriteFont.MeasureString(EnemyHealthLabel.Text);
            ControlManager.Add(EnemyHealthLabel);

            EnemyHealth = new Label();
            EnemyHealth.Position = new Vector2(250 + EnemyHealthLabel.Size.X, 440);
            EnemyHealth.Text = Enemies[0].CurrentHP.ToString();
            ControlManager.Add(EnemyHealth);

            EnemyLevelLabel = new Label();
            EnemyLevelLabel.Text = "Level: ";
            EnemyLevelLabel.Size = EnemyLevelLabel.SpriteFont.MeasureString(EnemyLevelLabel.Text);
            EnemyLevelLabel.Position = new Vector2(250, 465);
            ControlManager.Add(EnemyLevelLabel);

            EnemyLevel = new Label();
            EnemyLevel.Text = Enemies[0].Level.ToString();
            EnemyLevel.Position = new Vector2(250 + EnemyLevelLabel.Size.X, 465);
            ControlManager.Add(EnemyLevel);

            if (Enemies.Count() > 1)
            {
                SecondEnemyBackground = new PictureBox(
                    Enemies[1].image,
                     new Rectangle(600, 250,
                     Enemies[1].image.Width * 3, Enemies[1].image.Height * 3));
                ControlManager.Add(SecondEnemyBackground);

                SecondEnemyName = new Label();
                SecondEnemyName.Text = Enemies[1].name;
                SecondEnemyName.Position = new Vector2(600, 220);
                ControlManager.Add(SecondEnemyName);

                SecondEnemyHealthLabel = new Label();
                SecondEnemyHealthLabel.Text = "Health:";
                SecondEnemyHealthLabel.Position = new Vector2(600, 440);
                SecondEnemyHealthLabel.Size = EnemyHealthLabel.SpriteFont.MeasureString(EnemyHealthLabel.Text);
                ControlManager.Add(SecondEnemyHealthLabel);

                SecondEnemyHealth = new Label();
                SecondEnemyHealth.Position = new Vector2(600 + EnemyHealthLabel.Size.X, 440);
                SecondEnemyHealth.Text = Enemies[1].CurrentHP.ToString();
                ControlManager.Add(SecondEnemyHealth);

                SecondEnemyLevelLabel = new Label();
                SecondEnemyLevelLabel.Text = "Level: ";
                SecondEnemyLevelLabel.Size = EnemyLevelLabel.SpriteFont.MeasureString(EnemyLevelLabel.Text);
                SecondEnemyLevelLabel.Position = new Vector2(600, 465);
                ControlManager.Add(SecondEnemyLevelLabel);

                SecondEnemyLevel = new Label();
                SecondEnemyLevel.Text = Enemies[1].Level.ToString();
                SecondEnemyLevel.Position = new Vector2(600 + EnemyLevelLabel.Size.X, 465);
                ControlManager.Add(SecondEnemyLevel);
            }

            PlayerName = new Label();
            PlayerName.Position = new Vector2(300, 800);
            PlayerName.Text = Player.name;
            ControlManager.Add(PlayerName);

            Label LevelLabel = new Label();
            LevelLabel.Text = "Level:";
            LevelLabel.Size = LevelLabel.SpriteFont.MeasureString(LevelLabel.Text);
            LevelLabel.Position = new Vector2(300, 855);
            ControlManager.Add(LevelLabel);

            Label PlayerHealthLabel = new Label();
            PlayerHealthLabel.Text = "Health:";
            PlayerHealthLabel.Position = new Vector2(300, 830);
            PlayerHealthLabel.Size = PlayerHealthLabel.SpriteFont.MeasureString(PlayerHealthLabel.Text);
            ControlManager.Add(PlayerHealthLabel);

            PlayerHealth = new Label();
            PlayerHealth.Position = new Vector2(300 + PlayerHealthLabel.Size.X, 830);
            PlayerHealth.Text = Player.CurrentHP.ToString();
            ControlManager.Add(PlayerHealth);

            PlayerLevel = new Label();
            PlayerLevel.Position = new Vector2(300 + LevelLabel.Size.X, 855);
            PlayerLevel.Text = Player.Level.ToString();
            ControlManager.Add(PlayerLevel);

            Label ManaLabel = new Label();
            ManaLabel.Text = "Mana: ";
            ManaLabel.Size = ManaLabel.SpriteFont.MeasureString(ManaLabel.Text);
            ManaLabel.Position = new Vector2(300, 880);
            ControlManager.Add(ManaLabel);

            PlayerMana = new Label();
            PlayerMana.Position = new Vector2(300 + ManaLabel.Size.X, 880);
            PlayerMana.Text = Player.CurrentMana.ToString();
            ControlManager.Add(PlayerMana);

            PlayerTurn();
        }
Exemplo n.º 5
0
        protected override void LoadContent()
        {
            base.LoadContent();
            ContentManager Content = Game.Content;

            Background = new PictureBox(Content.Load<Texture2D>(@"Backgrounds\MenuBackground"), GameRef.ScreenRectangle);
            ControlManager.Add(Background);

            Texture2D arrow = Content.Load<Texture2D>(@"GUI\leftarrowUp");

            ArrowTexture = new PictureBox(
                arrow,
                new Rectangle(0, 0, arrow.Width, arrow.Height));
            ControlManager.Add(ArrowTexture);

            Label NameLabel = new Label();
            NameLabel.Text = "Name: ";
            NameLabel.Position = new Vector2(200, 200);
            NameLabel.Size = NameLabel.SpriteFont.MeasureString(NameLabel.Text);
            ControlManager.Add(NameLabel);

            CharacterName = new Label();
            CharacterName.Text = Player.name;
            CharacterName.Position = new Vector2(200 + NameLabel.Size.X, 200);
            ControlManager.Add(CharacterName);

            Label HealthLabel = new Label();
            HealthLabel.Text = "Health: ";
            HealthLabel.Size = HealthLabel.SpriteFont.MeasureString(HealthLabel.Text);
            HealthLabel.Position = new Vector2(200, 250);
            ControlManager.Add(HealthLabel);

            PlayerHealth = new Label();
            PlayerHealth.Text = Player.CurrentHP.ToString();
            PlayerHealth.Size = PlayerHealth.SpriteFont.MeasureString(PlayerHealth.Text);
            PlayerHealth.Position = new Vector2(200 + HealthLabel.Size.X, 250);
            ControlManager.Add(PlayerHealth);

            Label TotalHealth = new Label();
            TotalHealth.Text = " / " + Player.HP.ToString();
            TotalHealth.Position = new Vector2(PlayerHealth.Position.X + PlayerHealth.Size.X, 250);
            ControlManager.Add(TotalHealth);

            Label ManaLabel = new Label();
            ManaLabel.Text = "Mana: ";
            ManaLabel.Position = new Vector2(200, 300);
            ManaLabel.Size = ManaLabel.SpriteFont.MeasureString(ManaLabel.Text);
            ControlManager.Add(ManaLabel);

            Label PlayerMana = new Label();
            PlayerMana.Text = Player.CurrentMana.ToString();
            PlayerMana.Size = PlayerMana.SpriteFont.MeasureString(PlayerMana.Text);
            PlayerMana.Position = new Vector2(200 + ManaLabel.Size.X, 300);
            ControlManager.Add(PlayerMana);

            Label TotalMana = new Label();
            TotalMana.Text = " / " + Player.mana.ToString();
            TotalMana.Position = new Vector2(PlayerMana.Position.X + PlayerMana.Size.X, 300);
            ControlManager.Add(TotalMana);

            Label AttackLabel = new Label();
            AttackLabel.Text = "Attack: ";
            AttackLabel.Position = new Vector2(200, 350);
            AttackLabel.Size = AttackLabel.SpriteFont.MeasureString(AttackLabel.Text);
            ControlManager.Add(AttackLabel);

            PlayerAttack = new Label();
            PlayerAttack.Text = Player.Atk.ToString();
            PlayerAttack.Position = new Vector2(200 + AttackLabel.Size.X, 350);
            ControlManager.Add(PlayerAttack);

            Label DefenseLabel = new Label();
            DefenseLabel.Text = "Defense: ";
            DefenseLabel.Position = new Vector2(200, 400);
            DefenseLabel.Size = DefenseLabel.SpriteFont.MeasureString(DefenseLabel.Text);
            ControlManager.Add(DefenseLabel);

            PlayerDefense = new Label();
            PlayerDefense.Text = Player.Defense.ToString();
            PlayerDefense.Position = new Vector2(200 + DefenseLabel.Size.X, 400);
            ControlManager.Add(PlayerDefense);

            Label SpecialAtkLabel = new Label();
            SpecialAtkLabel.Text = "Special Attack: ";
            SpecialAtkLabel.Position = new Vector2(200, 450);
            SpecialAtkLabel.Size = SpecialAtkLabel.SpriteFont.MeasureString(SpecialAtkLabel.Text);
            ControlManager.Add(SpecialAtkLabel);

            PlayerSpecialAtk = new Label();
            PlayerSpecialAtk.Text = Player.SpecAttack.ToString();
            PlayerSpecialAtk.Position = new Vector2(200 + SpecialAtkLabel.Size.X, 450);
            ControlManager.Add(PlayerSpecialAtk);

            Label SpecialDefLabel = new Label();
            SpecialDefLabel.Text = "Special Defense: ";
            SpecialDefLabel.Position = new Vector2(200, 500);
            SpecialDefLabel.Size = SpecialDefLabel.SpriteFont.MeasureString(SpecialDefLabel.Text);
            ControlManager.Add(SpecialDefLabel);

            PlayerSpecialDef = new Label();
            PlayerSpecialDef.Text = Player.SpecDefense.ToString();
            PlayerSpecialDef.Position = new Vector2(200 + SpecialDefLabel.Size.X, 500);
            ControlManager.Add(PlayerSpecialDef);

            ContinueGame = new LinkLabel();
            ContinueGame.Text = "Continue Game";
            ContinueGame.Size = ContinueGame.SpriteFont.MeasureString(ContinueGame.Text);
            ContinueGame.Selected += new EventHandler(ContinueGame_Selected);
            ControlManager.Add(ContinueGame);

            QuitGame = new LinkLabel();
            QuitGame.Text = "Quit Game";
            QuitGame.Size = QuitGame.SpriteFont.MeasureString(QuitGame.Text);
            QuitGame.Selected += new EventHandler(QuitGame_Selected);
            ControlManager.Add(QuitGame);

            ControlManager.NextControl();

            ControlManager.FocusedChanged += new EventHandler(ControlManager_FocusedChanged);

            Vector2 position = new Vector2(200, 600);

            foreach (Control c in ControlManager)
            {
                if (c is LinkLabel)
                {

                    if (c.Size.X > MaxItemWidth)
                        maxItemWidth = c.Size.X;

                    c.Position = position;
                    position.Y += c.Size.Y + 5f;
                }

            }

            ControlManager_FocusedChanged(ContinueGame, null);
        }