示例#1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.

            sb          = new ExtendedSpriteBatch(GraphicsDevice);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            viewport    = graphics.GraphicsDevice.Viewport;
            // plLives.LoadContent(Content, "");
            player.LoadContent(Content, "dot");
            bgTL.LoadContent(Content, "bgTL");
            bgTR.LoadContent(Content, "bgTR");
            bgBL.LoadContent(Content, "bgBL");
            bgBR.LoadContent(Content, "bgBR");
            bgTL.Position = new Vector2(0, 0);
            bgTR.Position = new Vector2(1024, 0);
            bgBL.Position = new Vector2(0, 720);
            bgBR.Position = new Vector2(1024, 720);
            cam           = new Camera2D(viewport);
            song          = Content.Load <Song>("heartbeat");
            viztext       = Content.Load <Texture2D>("viz");

            MediaPlayer.Play(song);

            MediaPlayer.IsRepeating = true;

            // TODO: use this.Content to load your game content here
        }