コード例 #1
0
 /// <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));
 }
コード例 #2
0
 /// <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));
 }
コード例 #3
0
 /// <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));
 }