Exemplo n.º 1
0
        public Vector2 DrawTextureWithOffset(Vector2 position, string asset, Color blend, AlignOffset align = AlignOffset.TopLeft)
        {
            var texture = LoadTexture(asset);
            var offset  = Vector2.Zero;

            switch (align)
            {
            case AlignOffset.TopRight: offset = new Vector2(-texture.Width, 0); break;

            case AlignOffset.BottomLeft: offset = new Vector2(0, -texture.Height); break;

            case AlignOffset.BottomRight: offset = new Vector2(-texture.Width, -texture.Height); break;
            }

            _spriteBatch.Draw(texture, position + offset, blend);
            return(new Vector2(texture.Width, texture.Height));
        }
Exemplo n.º 2
0
 public Vector2 DrawTextureWithOffset(Vector2 position, string asset, AlignOffset align = AlignOffset.TopLeft)
 {
     return(DrawTextureWithOffset(position, asset, Color.White, align));
 }