Example #1
0
        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);
            }
        }
Example #2
0
 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;
 }