示例#1
0
 public static Rectangle GetFontRectangle(Vector2 position, string fontName, string String)
 {
     return(new Rectangle(
                (int)position.X,
                (int)position.Y,
                (int)FontProvider.GetFont(fontName).MeasureString(String).X,
                (int)FontProvider.GetFont(fontName).MeasureString(String).Y));
 }
示例#2
0
 public static Vector2 GetFontCenter(string fontName, string String)
 {
     return(new Vector2(
                FontProvider.GetFont(fontName).MeasureString(String).X / 2,
                FontProvider.GetFont(fontName).MeasureString(String).Y / 2));
 }