Exemplo 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.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            terrainSprite = Content.Load<Texture2D>(@"Terrain");

            camera = new Camera(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height, Config.SpriteSize);
        }
Exemplo n.º 2
0
 public void ConvertCoordinates()
 {
     var camera = new Camera(100, 200, 10);
     Assert.AreEqual(new Point(0, 200 - 10), camera.View(new Point(0, 0)));
     Assert.AreEqual(new Point(3, 200 - 13), camera.View(new Point(3, 3)));
 }