public static void DrawText(this SpriteBatch batch, FontRenderer fontRenderer, string text, Vector2 position, Color color) { var size = fontRenderer.MeasureText(text); var borders = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y); DrawText(batch, fontRenderer, text, borders, color); }
public Size2 MeasureText(string text, int height, FontDrawFlags align = FontDrawFlags.Left) { return(fontRenderer.MeasureText(text, "Verdana", height, align)); }