Ejemplo n.º 1
0
 public virtual void Draw(ScaledSpriteBatch scaledSpriteBatch)
 {
     scaledSpriteBatch.Draw(Texture, Position, Size);
 }
Ejemplo n.º 2
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.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            scaledSpriteBatch = new ScaledSpriteBatch(spriteBatch);
#if NETFX_CORE
            // this next statement allows us to specify a larger font size for Win8 MonoGame. Because
            // XNA and MonoGame use bitmapped fonts, if we didn't scale this then when we went to a bigger screen 
            // for Win8 the text would appear blurry and antialiased. Ideally you could specify even more sizes and scales to look
            // good at even higher resolutions.
            // In this case we decided to specify font sizes 3 times bigger for Win8, so we need to set TextScale to the inverse of that.
            scaledSpriteBatch.TextScale = 1 / 3f;
#endif
            bricksTexture = Content.Load<Texture2D>("bricks");
            dog.Texture = Content.Load<Texture2D>("dog");
            chicken.Texture = Content.Load<Texture2D>("chicken");
            groundTexture = Content.Load<Texture2D>("ground");
            skyTexture = Content.Load<Texture2D>("sky"); 
            eggTexture = Content.Load<Texture2D>("egg");
            scoreFont = Content.Load<SpriteFont>("scoreFont");
            gameOverFont = Content.Load<SpriteFont>("gameOverFont");
        }