コード例 #1
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;
            backgroundTexture = content.Load<Texture2D>(@"images\scene\MainMenuScene\main");
            backgroundPosition = new Vector2(0, 0);

            Texture2D texture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_play");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_play_clicked");
            button[0] = new Button(texture, null, pressTexture, new Vector2(22, 670));

            texture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_scores");
            pressTexture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_scores_clicked");
            button[1] = new Button(texture, null, pressTexture, new Vector2(202, 670));

            texture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_options");
            pressTexture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_options_clicked");
            button[2] = new Button(texture, null, pressTexture, new Vector2(431, 670));

            texture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_help");
            pressTexture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_help_clicked");
            button[3] = new Button(texture, null, pressTexture, new Vector2(669, 670));

            texture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_quit");
            pressTexture = content.Load<Texture2D>(@"images\scene\MainMenuScene\b_quit_clicked");
            button[4] = new Button(texture, null, pressTexture, new Vector2(837, 670));

            button[0].Clicked += PlayButtonClicked;
            button[1].Clicked += ScoresButtonClicked;
            button[2].Clicked += OptionsButtonClicked;
            button[3].Clicked += HelpButtonClicked;
            button[4].Clicked += QuitButtonClicked;

            openGameSong = content.Load<Song>(@"audio\song\open_game");
        }
コード例 #2
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;

            backgroundTexture = content.Load<Texture2D>(@"images\scene\ConfirmScene\confirm_form");
            Viewport viewport = SceneManager.GraphicsDevice.Viewport;
            backgroundPosition = new Vector2(
                (viewport.Width - backgroundTexture.Width) / 2,
                (viewport.Height - backgroundTexture.Height) / 2);
            loadingBlackTextureDestination = new Rectangle(viewport.X, viewport.Y,
                viewport.Width, viewport.Height);

            loadingBlackTexture = content.Load<Texture2D>(@"images\scene\CommonButton\FadeScreen");

            Texture2D texture = content.Load<Texture2D>(@"images\scene\ConfirmScene\b_yes");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\ConfirmScene\b_yes_clicked");
            Vector2 position = backgroundPosition + new Vector2(170, 173);
            yesButton = new Button(texture, null, pressTexture, position);
            yesButton.Clicked += YesButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\ConfirmScene\b_no");
            pressTexture = content.Load<Texture2D>(@"images\scene\ConfirmScene\b_no_clicked");
            position = backgroundPosition + new Vector2(380, 173);
            noButton = new Button(texture, null, pressTexture, position);
            noButton.Clicked += NoButtonClicked;
        }
コード例 #3
0
        public override void LoadContent()
        {
            ContentManager Content = sceneManager.Game.Content;

            BackgroundTexture = Content.Load<Texture2D>(@"images\scene\CommonButton\FadeScreen");
            Viewport viewport = SceneManager.GraphicsDevice.Viewport;
            BackgroundRectangle = new Rectangle(viewport.X, viewport.Y, viewport.Width, viewport.Height);

            Texture2D textbox_texture = Content.Load<Texture2D>(@"images\scene\TextBoxScene\textbox_dialog");
            Texture2D caret_texture = Content.Load<Texture2D>(@"images\scene\TextBoxScene\caret");
            SpriteFont text_font = Content.Load<SpriteFont>(@"fonts\TextBoxScene\textinput");
            textBox = new TextBox(textbox_texture, caret_texture, text_font);
            textBox.Center = new Vector2(512, 384);
            textBox.TextOffset = new Vector2(60, 95);
            textBox.Width = 500;
            textBox.OnEnterPressed += TextBoxEnter_Pressed;
            GameManager.keyboard_dispatcher.Subscriber = textBox;

            Texture2D normalTexture, pressTexture;
            normalTexture = Content.Load<Texture2D>(@"images\scene\TextBoxScene\b_save_normal");
            pressTexture = Content.Load<Texture2D>(@"images\scene\TextBoxScene\b_save_press");
            SaveButton = new Button(normalTexture, null, pressTexture, new Vector2(230, 420));
            SaveButton.Clicked += SaveButton_Clicked;

            normalTexture = Content.Load<Texture2D>(@"images\scene\TextBoxScene\b_cancel_normal");
            pressTexture = Content.Load<Texture2D>(@"images\scene\TextBoxScene\b_cancel_press");
            CancelButton = new Button(normalTexture, null, pressTexture, new Vector2(580, 420));
            CancelButton.Clicked += CancelButton_Clicked;
        }
コード例 #4
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;
            backgroundTexture = content.Load<Texture2D>(@"images\scene\ScoreScene\scoreboard");
            backgroundPosition = new Vector2(0, 0);

            Texture2D texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_back");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_back_clicked");
            button = new Button(texture, null, pressTexture, new Vector2(403, 685));
            button.Clicked += BackButtonClicked;

            scoreFont = content.Load<SpriteFont>(@"fonts\ScoreScene\score");
            for (int i = 0; i < 8; i++)
            {
                scorePosition[i] = new Vector2(260, 115) + i * (new Vector2(0, 70));
            }
        }
コード例 #5
0
        public virtual void LoadContent()
        {
            ContentManager Content = gameplay.SceneManager.Game.Content;
            Texture2D normalTexture,pressTexture;

            normalTexture = Content.Load<Texture2D>(@"images\gameplay\EndGameLayer\mission_finished");
            MissionLabel = new Label();
            MissionLabel.Texture = normalTexture;
            MissionLabel.Center = new Vector2(512, 384);

            normalTexture = Content.Load<Texture2D>(@"images\gameplay\EndGameLayer\replay_normal_but");
            pressTexture = Content.Load<Texture2D>(@"images\gameplay\EndGameLayer\replay_press_but");
            ReplayButton = new Button(normalTexture, null, pressTexture, new Vector2(200, 100));
            ReplayButton.Clicked += ReplayButton_Clicked;

            normalTexture = Content.Load<Texture2D>(@"images\gameplay\EndGameLayer\continue_normal_but");
            pressTexture = Content.Load<Texture2D>(@"images\gameplay\EndGameLayer\continue_press_but");
            ContinueButton = new Button(normalTexture, null, pressTexture, new Vector2(100, 300));
            ContinueButton.Clicked += ContinueButton_Clicked;
        }
コード例 #6
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;

            backgroundTexture = content.Load<Texture2D>(@"images\scene\MenuPause\menu");
            Viewport viewport = SceneManager.GraphicsDevice.Viewport;
            backgroundPosition = new Vector2(
                (viewport.Width - backgroundTexture.Width) / 2,
                (viewport.Height - backgroundTexture.Height) / 2);
            loadingBlackTextureDestination = new Rectangle(viewport.X, viewport.Y,
                viewport.Width, viewport.Height);

            loadingBlackTexture = content.Load<Texture2D>(@"images\scene\CommonButton\FadeScreen");

            Texture2D texture = content.Load<Texture2D>(@"images\scene\MenuPause\b_resume");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\MenuPause\b_resume_clicked");
            Vector2 position = backgroundPosition + new Vector2(49, 100);
            resumeButton = new Button(texture, null, pressTexture, position);
            resumeButton.Clicked += ResumeButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\MenuPause\b_reset");
            pressTexture = content.Load<Texture2D>(@"images\scene\MenuPause\b_reset_clicked");
            position = backgroundPosition + new Vector2(49, 200);
            restartButton = new Button(texture, null, pressTexture, position);
            restartButton.Clicked += RestartButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\MenuPause\b_options");
            pressTexture = content.Load<Texture2D>(@"images\scene\MenuPause\b_options_clicked");
            position = backgroundPosition + new Vector2(49, 300);
            optionButton = new Button(texture, null, pressTexture, position);
            optionButton.Clicked += OptionButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\MenuPause\b_exits");
            pressTexture = content.Load<Texture2D>(@"images\scene\MenuPause\b_exits_clicked");
            position = backgroundPosition + new Vector2(49, 400);
            exitButton = new Button(texture, null, pressTexture, position);
            exitButton.Clicked += ExitButtonClicked;
        }
コード例 #7
0
        public void LoadContent()
        {
            ContentManager Content = gameplay.SceneManager.Game.Content;
            Texture2D texture;
            Texture2D textureActive;
            Texture2D textureInactive;

            font = Content.Load<SpriteFont>(@"fonts\gameplay\hud_font");
            texture = Content.Load<Texture2D>(@"images\gameplay\buttons\life_label");
            LifeLabel = new Label(texture, new Vector2(800,50));

            texture = Content.Load<Texture2D>(@"images\gameplay\buttons\money_label");
            MoneyLabel = new Label(texture, new Vector2(20,35));

            textureActive = Content.Load<Texture2D>(@"images\gameplay\buttons\pause_enable_but");
            textureInactive = Content.Load<Texture2D>(@"images\gameplay\buttons\play_enable_but");
            playButton = new ToggleButton(textureActive, null, null, textureInactive, new Vector2(75,675));
            playButton.Clicked += PlayButton_Clicked;
            playButton.Active = true;

            textureActive = Content.Load<Texture2D>(@"images\gameplay\buttons\fast_enable_but");
            textureInactive = Content.Load<Texture2D>(@"images\gameplay\buttons\fast_disable_but");
            fastButton = new ToggleButton(textureActive, null, null, textureInactive, new Vector2(135,675));
            fastButton.Clicked += FastButton_Clicked;
            fastButton.Active = false;

            textureActive = Content.Load<Texture2D>(@"images\gameplay\buttons\setting_enable_but");
            textureInactive = Content.Load<Texture2D>(@"images\gameplay\buttons\setting_disable_but");
            settingButton = new Button(textureInactive,null, textureActive, new Vector2(203,675));
            settingButton.Clicked += SettingButton_Clicked;
        }
コード例 #8
0
        public void LoadContent(ContentManager Content)
        {
            Texture2D texture, hoverTexture;
            texture = Content.Load<Texture2D>(@"images\gameplay\buttons\next_waves_label");
            NextWavesLabel = new Label(texture, new Vector2(975,100));

            texture = Content.Load<Texture2D>(@"images\gameplay\buttons\arrow_normal_but");
            hoverTexture = Content.Load<Texture2D>(@"images\gameplay\buttons\arrow_hover_but");
            ArrowButton = new Button(texture, hoverTexture, null, new Vector2(975,100) + ArrowOffset);
            ArrowButton.Hovered += ArrowButton_Hovered;

            font = Content.Load<SpriteFont>(@"fonts\gameplay\next_wave");
        }
コード例 #9
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;
            backgroundTexture = content.Load<Texture2D>(@"images\scene\HelpScene\help");
            backgroundPosition = new Vector2(0, 0);

            Texture2D texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_back");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_back_clicked");
            backButton = new Button(texture, null, pressTexture, new Vector2(403, 685));
            backButton.Clicked += BackButtonClicked;

            Texture2D disableButton = content.Load<Texture2D>(@"images\scene\CommonButton\b_backward_disable");
            texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_backward");
            pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_backward_clicked");
            backwardButton = new ToggleButton(texture, null, pressTexture, disableButton, new Vector2(50, 510));
            backwardButton.Clicked += BackwardButtonClicked;

            disableButton = content.Load<Texture2D>(@"images\scene\CommonButton\b_forward_disable");
            texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_forward");
            pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_forward_clicked");
            forwardButton = new ToggleButton(texture, null, pressTexture, disableButton, new Vector2(900, 510));
            forwardButton.Clicked += ForwardButtonClicked;

            itemCard[0] = content.Load<Texture2D>(@"images\scene\HelpScene\oak_card");
            itemCard[1] = content.Load<Texture2D>(@"images\scene\HelpScene\cactus_card");
            itemCard[2] = content.Load<Texture2D>(@"images\scene\HelpScene\pineapple_card");

            towerInGameTexture[0] = content.Load<Texture2D>(@"images\scene\HelpScene\oak_in_game");
            towerInGameTexture[1] = content.Load<Texture2D>(@"images\scene\HelpScene\cactus_in_game");
            towerInGameTexture[2] = content.Load<Texture2D>(@"images\scene\HelpScene\pineapple_in_game");

            TowerLoadManager.LoadContent(content);

            hightlightSelectTexture = content.Load<Texture2D>(@"images\scene\CommonButton\highlight_select_card");
            lockTexture = content.Load<Texture2D>(@"images\scene\CommonButton\lock_card");
            helpFont = content.Load<SpriteFont>(@"fonts\HelpScene\helpScene");

            towerLevelTexture[0] = OakTower.TEXTURE_LV1;
            towerLevelTexture[1] = OakTower.TEXTURE_LV2;
            towerLevelTexture[2] = OakTower.TEXTURE_LV3;
        }
コード例 #10
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;

            MapLoadManager.LoadAllMap(content, UserData.MAX_MAP_NUMBER);
            backgroundTexture = content.Load<Texture2D>(@"images\scene\SelectLevelScene\selectmaps");
            backgroundPosition = new Vector2(0, 0);

            Texture2D texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_back");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_back_clicked");
            backButton = new Button(texture, null, pressTexture, new Vector2(627, 685));
            backButton.Clicked += BackButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\SelectLevelScene\b_start_game");
            pressTexture = content.Load<Texture2D>(@"images\scene\SelectLevelScene\b_start_game_clicked");
            startButton = new Button(texture, null, pressTexture, new Vector2(180, 685));
            startButton.Clicked += StartButtonClicked;

            Texture2D disableButton = content.Load<Texture2D>(@"images\scene\CommonButton\b_backward_disable");
            texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_backward");
            pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_backward_clicked");
            backwardButton = new ToggleButton(texture, null, pressTexture, disableButton, new Vector2(50, 510));
            backwardButton.Clicked += BackwardButtonClicked;

            disableButton = content.Load<Texture2D>(@"images\scene\CommonButton\b_forward_disable");
            texture = content.Load<Texture2D>(@"images\scene\CommonButton\b_forward");
            pressTexture = content.Load<Texture2D>(@"images\scene\CommonButton\b_forward_clicked");
            forwardButton = new ToggleButton(texture, null, pressTexture, disableButton, new Vector2(900, 510));
            forwardButton.Clicked += ForwardButtonClicked;

            PreviewScale = Math.Min(368/(float) MapLoadManager.getMap(0).BackgroundTexture.Width,
                276/(float)MapLoadManager.getMap(0).BackgroundTexture.Height);

            lockTexture = content.Load<Texture2D>(@"images\scene\CommonButton\lock_card");
            hightlightSelectTexture = content.Load<Texture2D>(@"images\scene\CommonButton\highlight_select_card");
            selectLevelFont = content.Load<SpriteFont>(@"fonts\SelectLevelScene\select_level");

            selectModeTexture = content.Load<Texture2D>(@"images\scene\SelectLevelScene\b_select_level");
            UserData.currentMapMode = (int)Mode.Standard;
        }
コード例 #11
0
        public override void LoadContent()
        {
            ContentManager content = SceneManager.Game.Content;

            backgroundTexture = content.Load<Texture2D>(@"images\scene\OptionScene\dialog_options");
            loadingBlackTexture = content.Load<Texture2D>(@"images\scene\CommonButton\FadeScreen");

            Viewport viewport = SceneManager.GraphicsDevice.Viewport;
            backgroundPosition = new Vector2(
                (viewport.Width - backgroundTexture.Width) / 2,
                (viewport.Height - backgroundTexture.Height) / 2);
            loadingBlackTextureDestination = new Rectangle(viewport.X, viewport.Y,
                viewport.Width, viewport.Height);

            tickTexture = content.Load<Texture2D>(@"images\scene\OptionScene\tick_full_screen");
            tickPosition = backgroundPosition + new Vector2(78, 76);

            Texture2D texture = content.Load<Texture2D>(@"images\scene\OptionScene\b_close");
            Texture2D pressTexture = content.Load<Texture2D>(@"images\scene\OptionScene\b_close_clicked");
            Vector2 position = backgroundPosition + new Vector2(645, 15);
            closeButton = new Button(texture, null, pressTexture, position);
            closeButton.Clicked += CloseButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\OptionScene\decrease_volume");
            pressTexture = content.Load<Texture2D>(@"images\scene\OptionScene\decrease_volume_clicked");
            position = backgroundPosition + new Vector2(294, 179);//300 185
            decreMusicButton = new Button(texture, null, pressTexture, position);
            decreMusicButton.Clicked += DecreMusicButtonClicked;

            position = backgroundPosition + new Vector2(294, 247);
            decreSoundButton = new Button(texture, null, pressTexture, position);
            decreSoundButton.Clicked += DecreSoundButtonClicked;

            texture = content.Load<Texture2D>(@"images\scene\OptionScene\increase_volume");
            pressTexture = content.Load<Texture2D>(@"images\scene\OptionScene\increase_volume_clicked");
            position = backgroundPosition + new Vector2(640, 164); //650.176
            increMusicButton = new Button(texture, null, pressTexture, position);
            increMusicButton.Clicked += IncreMusicButtonClicked;

            position = backgroundPosition + new Vector2(640, 233);
            increSoundButton = new Button(texture, null, pressTexture, position);
            increSoundButton.Clicked += IncreSoundButtonClicked;

            barTexture = content.Load<Texture2D>(@"images\scene\OptionScene\sound_bar");
            musicBarPosition = backgroundPosition + new Vector2(338, 183);
            soundBarPosition = backgroundPosition + new Vector2(338, 251);
        }
コード例 #12
0
        public override void LoadContent()
        {
            ContentManager Content = sceneManager.Game.Content;
            Texture2D normalTexture,pressTexture;

            BackgroundTexture = Content.Load<Texture2D>(@"images\scene\CommonButton\FadeScreen");
            Viewport viewport = SceneManager.GraphicsDevice.Viewport;
            BackgroundRectangle = new Rectangle(viewport.X, viewport.Y, viewport.Width, viewport.Height);

            normalTexture = Content.Load<Texture2D>(@"images\scene\EndGameScene\mission_finished");
            MissionLabel = new Label();
            MissionLabel.Texture = normalTexture;
            MissionLabel.Center = new Vector2(512, 450);

            normalTexture = Content.Load<Texture2D>(@"images\scene\EndGameScene\replay_normal_but");
            pressTexture = Content.Load<Texture2D>(@"images\scene\EndGameScene\replay_press_but");
            RestartButton = new Button(normalTexture, null, pressTexture, new Vector2(280, 580));
            RestartButton.Clicked += RestartButton_Clicked;

            normalTexture = Content.Load<Texture2D>(@"images\scene\EndGameScene\continue_normal_but");
            pressTexture = Content.Load<Texture2D>(@"images\scene\EndGameScene\continue_press_but");
            ContinueButton = new Button(normalTexture, null, pressTexture, new Vector2(560, 580));
            ContinueButton.Clicked += ContinueButton_Clicked;

            font = Content.Load<SpriteFont>(@"fonts\EndGameScene\end_game");

            MediaPlayer.Play(endGameSong);
        }