Beispiel #1
0
		// 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;
		}
Beispiel #2
0
 public Image(Texture2D texture, Rectangle? sourceRectangle = null)
 {
     _texture = texture;
     _sourceRectangle = sourceRectangle.GetValueOrDefault(_texture.Bounds);
     Bounds = _sourceRectangle;
 }