Ejemplo n.º 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
        }
Ejemplo n.º 2
0
 public void Draw(ExtendedSpriteBatch sb, Color color)
 {
     Rectangle src_rect = new Rectangle();
     src_rect.X = (frame % columns) * (int)size.X;
     src_rect.Y = (frame / columns) * (int)size.Y;
     src_rect.Width = (int)size.X;
     src_rect.Height = (int)size.Y;
     sb.Draw(image, Position, src_rect, color, rotation, pivot, scale, SpriteEffects.None, 0.0f);
 }
Ejemplo n.º 3
0
        public void Draw(ExtendedSpriteBatch sb, Color color)
        {
            Rectangle src_rect = new Rectangle();

            src_rect.X      = (frame % columns) * (int)size.X;
            src_rect.Y      = (frame / columns) * (int)size.Y;
            src_rect.Width  = (int)size.X;
            src_rect.Height = (int)size.Y;
            sb.Draw(image, Position, src_rect, color, rotation, pivot, scale, SpriteEffects.None, 0.0f);
        }
Ejemplo n.º 4
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
        }