The SpriteBatchExtension class extends Xna´s SpriteBatch class so that you can use it for drawing tiled maps like you would draw a texture.
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, Vector2 position)
This method will draw the whole map to the given position.
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, Rectangle destinationRectangle)
This method will draw the whole map to the given rectangle. The map will be stretched or compressed accordingly.
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, int x, int y, int width, int height, Vector2 position)
This method will draw the specified tiles of all layers of this map. The position is still the position of the whole map!
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, int x, int y, int width, int height, Rectangle destinationRectangle)
This method will draw the specified tiles af all layers to the specified rectangle.
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, Layer layer, Vector2 position)
This method will draw the specified layer of the map to the given position.
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, Layer layer, Rectangle destinationRectangle)
This method will draw the specified layer to the specified rectangle.
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, Layer layer, int x, int y, int width, int height, Vector2 position)
This method will draw the specified tiles of the specified layer to the given position.The position is still the position of the whole map!
public static void Draw(this SpriteBatch spriteBatch, TiledMap map, Layer layer, int x, int y, int width, int height, Rectangle destinationRectangle)
This method will draw the specified tiles of the specified layer to the given rectangle.