コード例 #1
0
ファイル: BattleUI.cs プロジェクト: mbg/FSEGame
        /// <summary>
        /// Initialises a new instance of this class.
        /// </summary>
        public BattleUI()
            : base("BattleUI")
        {
            this.opponentName = new StaticText(FSEGame.Singleton.DefaultFont);
            this.opponentName.Text = "<OPPONENT NAME>";
            this.opponentName.Position = new Vector2(50, 20);
            this.opponentName.TextColour = Color.Black;
            this.opponentName.HasShadow = false;

            this.playerName = new StaticText(FSEGame.Singleton.DefaultFont);
            this.playerName.Text = "Landor";
            this.playerName.Position = new Vector2(445, 385);
            this.playerName.TextColour = Color.Black;
            this.playerName.HasShadow = false;

            this.bossIcon = new StaticImage("Boss");
            this.bossIcon.Position = new Vector2(350, 20);
            this.bossIcon.Visible = false;

            this.opponentHealthBar = new UIProgressBar("ProgressBar", "ProgressBarFilled");
            this.opponentHealthBar.Position = new Vector2(35, 50);
            this.opponentHealthBar.Maximum = 100;
            this.opponentHealthBar.Value = 100;

            this.playerHealthBar = new UIProgressBar("ProgressBar", "ProgressBarFilled");
            this.playerHealthBar.Position = new Vector2(430, 415);
            this.playerHealthBar.Maximum = 100;
            this.playerHealthBar.Value = 100;

            this.mainBattleMenu = new UIButtonGrid(2, 2);
            this.mainBattleMenu.Visible = false;
            this.mainBattleMenu.Buttons[0, 0] = new UIGridButton("Attack", new Vector2(70, 500));
            this.mainBattleMenu.Buttons[0, 1] = new UIGridButton("Magic", new Vector2(500, 500));
            this.mainBattleMenu.Buttons[1, 0] = new UIGridButton("Items", new Vector2(70, 540));
            this.mainBattleMenu.Buttons[1, 1] = new UIGridButton("Skip?", new Vector2(500, 540));

            this.attackMenu = new UIButtonGrid(2, 2);
            this.attackMenu.Visible = false;
            this.attackMenu.Buttons[0, 0] = new UIGridButton("<MOVE 1>", new Vector2(70, 500));
            this.attackMenu.Buttons[0, 1] = new UIGridButton("<MOVE 2>", new Vector2(500, 500));
            this.attackMenu.Buttons[1, 0] = new UIGridButton("Back", new Vector2(70, 540));
            this.attackMenu.Buttons[1, 1] = new UIGridButton("<MOVE 3>", new Vector2(500, 540));

            base.Children.Add(this.opponentName);
            base.Children.Add(this.playerName);
            base.Children.Add(this.bossIcon);
            base.Children.Add(this.opponentHealthBar);
            base.Children.Add(this.playerHealthBar);
            base.Children.Add(this.mainBattleMenu);
            base.Children.Add(this.attackMenu);
        }
コード例 #2
0
ファイル: FSEGame.cs プロジェクト: mbg/FSEGame
        /// <summary>
        /// Loads content for the game.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent();

            this.mainMenu = new MainMenuScreen();
            this.gameOverScreen = new GameOverScreen();
            this.loadScreen = new LoadScreen();
            this.ingameMenu = new IngameMenu();
            this.saveScreen = new SaveScreen();
            this.battleUI = new BattleUI();
            this.fadeScreen = new FadeScreen();

            this.gameOverScreen.Visible = false;
            this.loadScreen.Visible = false;
            this.ingameMenu.Visible = false;
            this.saveScreen.Visible = false;
            this.battleUI.Visible = false;
            this.fadeScreen.Visible = false;

            this.UIElements.Add(this.mainMenu);
            this.UIElements.Add(this.gameOverScreen);
            this.UIElements.Add(this.loadScreen);
            this.UIElements.Add(this.ingameMenu);
            this.UIElements.Add(this.saveScreen);
            this.UIElements.Add(this.battleUI);
            this.UIElements.Add(this.fadeScreen);

            this.character = new CharacterController();

            this.camera = new Camera();

            this.debugText = new StaticText(this.DefaultFont);
            this.debugText.Position = new Vector2(20, 20);
            this.debugText.Visible = false;

            this.UIElements.Add(debugText);
        }