コード例 #1
0
        /*
         * [OnDeserializing]
         * public void JobSkillsDeserialization(StreamingContext context)
         * {
         *  backgroundRect = new Rectangle(0, 0, 800, 600);
         *  backgroundmusicPath = "jobskills/bgmusic01";
         *  backgroundPath = "jobskills/jobskills";
         * }*/


        public override void LoadContent(ContentManager Content)
        {
            displayLoading    = false;
            gamepadstate      = new GamePadState();
            mainMenuColors    = new Color[3];
            mainMenuColors[0] = Color.LightBlue;
            mainMenuColors[1] = Color.Blue;
            mainMenuColors[2] = Color.DarkBlue;
            mainMenuRect      = new Rectangle(200, 400, 300, 75);
            backgroundRect    = new Rectangle(0, 0, 800, 600);
            base.LoadContent(Content);
            // Create a new SpriteBatch, which can be used to draw textures.

            loadingImg  = Content.Load <Texture2D>("content/waitloading");
            loadingRect = new Rectangle(0, 0, 400, 100);

            backgroundmusic = Content.Load <Song>(backgroundmusicPath);
            MediaPlayer.Play(backgroundmusic);
            background = Content.Load <Texture2D>(backgroundPath);
            // TODO: use this.Content to load your game content here

            mainMenuImg = Content.Load <Texture2D>("content/mainmenu");

            mainMenuButtonSound = Content.Load <SoundEffect>("ResumeGamePlayState/boom");

            mainMenuButton = new LeapTimeButton(mainMenuColors, 3, mainMenuImg, mainMenuRect, mainMenuButtonSound);

            mainMenuButton.LoadContent(Content);
        }
コード例 #2
0
        public override void LoadContent(ContentManager Content)
        {
            Aimg            = Content.Load <Texture2D>("ResumeGamePlayState/buttonfolder/A");
            Bimg            = Content.Load <Texture2D>("ResumeGamePlayState/buttonfolder/B");
            Ximg            = Content.Load <Texture2D>("ResumeGamePlayState/buttonfolder/X");
            Yimg            = Content.Load <Texture2D>("ResumeGamePlayState/buttonfolder/Y");
            startImage      = Content.Load <Texture2D>("ResumeGamePlayState/buttonfolder/START");
            levelOneImage   = Content.Load <Texture2D>("content/levelone");
            levelTwoImage   = Content.Load <Texture2D>("content/leveltwo");
            levelThreeImage = Content.Load <Texture2D>("content/levelthree");
            levelFourImage  = Content.Load <Texture2D>("content/levelfour");
            levelFiveImage  = Content.Load <Texture2D>("content/levelfive");
            backgroundImage = Content.Load <Texture2D>("backgrounds/deepestmaster");
            mainMenuImage   = Content.Load <Texture2D>("content/mainmenu");
            loadingImg      = Content.Load <Texture2D>("content/waitloading");

            buttonSound     = Content.Load <SoundEffect>("ResumeGamePlayState/boom");
            backgroundMusic = Content.Load <Song>("ResumeGamePlayState/bgmusic01");

            MediaPlayer.Play(backgroundMusic);

            levelOneButton   = new LeapTimeButton(buttonColors, numberOfSecondsForButtons, levelOneImage, levelOneRect, buttonSound);
            levelTwoButton   = new LeapTimeButton(buttonColors, numberOfSecondsForButtons, levelTwoImage, levelTwoRect, buttonSound);
            levelThreeButton = new LeapTimeButton(buttonColors, numberOfSecondsForButtons, levelThreeImage, levelThreeRect, buttonSound);
            levelFourButton  = new LeapTimeButton(buttonColors, numberOfSecondsForButtons, levelFourImage, levelFourRect, buttonSound);
            levelFiveButton  = new LeapTimeButton(buttonColors, numberOfSecondsForButtons, levelFiveImage, levelFiveRect, buttonSound);
            levelOneButton.LoadContent(Content);
            levelTwoButton.LoadContent(Content);
            levelThreeButton.LoadContent(Content);
            levelFourButton.LoadContent(Content);
            levelFiveButton.LoadContent(Content);
        }
コード例 #3
0
        public override void LoadContent(ContentManager Content)
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            base.LoadContent(Content);
            background  = Content.Load <Texture2D>(backgroundPath);
            videoplayer = new VideoPlayer();
            video       = Content.Load <Video>(videoPath);
            video2      = Content.Load <Video>(video2Path);
            // TODO: use this.Content to load your game content here
            videogamemusic = Content.Load <Song>(videogamemusicPath);
            font           = Content.Load <SpriteFont>(fontPath);
            if (state == 0)
            {
                videoplayer.Play(video2);
            }
            else if (state == 1)
            {
                videoplayer.Play(video);
            }

            if (PlayTheMusic.Yes == playTheMusic)
            {
                MediaPlayer.Play(videogamemusic);
            }

            else if (PlayTheMusic.No == playTheMusic)
            {
                MediaPlayer.Stop();
            }
            loadingImg          = Content.Load <Texture2D>("content/waitloading");
            loadingRect         = new Rectangle(0, 0, 400, 100);
            continueButtonImg   = Content.Load <Texture2D>(continueButtonImgPath);
            continueButtonRect  = new Rectangle(50, 200, 239, 59);
            soundContinueButton = Content.Load <SoundEffect>(soundContinueButtonPath);
            continueButton      = new LeapTimeButton(continueButtonImg, continueButtonRect, soundContinueButton);
            continueButton.LoadContent(Content);
        }