/// <summary> /// Draws the text in the center of text system. /// </summary> /// <param name="textSystem">The text system.</param> /// <param name="text">The text.</param> /// <param name="fontName">Name of the font.</param> /// <returns>The text system.</returns> public static ITextSystem DrawCenter(this ITextSystem textSystem, string text, string fontName = null) { return(textSystem.DrawCenter(text, Color.White, fontName)); }
/// <summary> /// Draws the text in the center of bounds using the specified offset. /// </summary> /// <param name="textSystem">The text system.</param> /// <param name="offsetX">The offset x.</param> /// <param name="offsetY">The offset y.</param> /// <param name="text">The text.</param> /// <param name="bounds">The bounds.</param> /// <param name="fontName">Name of the font.</param> /// <returns>The text system.</returns> public static ITextSystem DrawCenter(this ITextSystem textSystem, float offsetX, float offsetY, string text, Rectangle bounds, string fontName = null) { return(textSystem.DrawCenter(offsetX, offsetY, text, bounds, Color.White, fontName)); }
/// <summary> /// Draws the text in the center of text system. /// </summary> /// <param name="textSystem">The text system.</param> /// <param name="text">The text.</param> /// <param name="color">The text color.</param> /// <param name="fontName">Name of the font.</param> /// <returns>The text system.</returns> public static ITextSystem DrawCenter(this ITextSystem textSystem, string text, Color color, string fontName = null) { return(textSystem.DrawCenter(text, textSystem.Context.Bounds, color, fontName)); }