// Constructor. public Glyph(char character, BitmapContent bitmap, Rectangle? subrect = null) { this.Character = character; this.Bitmap = bitmap; this.Subrect = subrect.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height)); this.Width = bitmap.Width; this.Height = bitmap.Height; }
public Image(Texture2D texture, Rectangle? sourceRectangle = null) { _texture = texture; _sourceRectangle = sourceRectangle.GetValueOrDefault(_texture.Bounds); Bounds = _sourceRectangle; }