private void Draw(TextureRegion textureRegion, Rectangle destinationRectangle) { var texture = textureRegion.Texture; if (texture != null) { var sourceRectangle = new Rectangle(textureRegion.X, textureRegion.Y, textureRegion.Width, textureRegion.Height); _spriteBatch.Draw(texture, destinationRectangle, sourceRectangle, Color.White); } }
public ITextureRegion AddRegion(string name, int x, int y, int width, int height) { var region = new TextureRegion(Texture, x, y, width, height); _regions.Add(name, region); return region; }