/// <summary> /// Draws a string. /// </summary> /// <param name="text">The Text.</param> /// <param name="font">The Font.</param> /// <param name="rectangle">The Rectangle.</param> /// <param name="color">The Color.</param> public void DrawString(string text, Font font, Rectangle rectangle, Color color) { var dxFont = font.Instance as DirectXFont; if (dxFont == null) { throw new ArgumentException("DirectX10 expects a DirectXFont as resource."); } _renderTarget.DrawText(text, dxFont.GetFont(), new RectangleF(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height), DirectXHelper.ConvertSolidColorBrush(color)); }
/// <summary> /// Draws a string. /// </summary> /// <param name="text">The Text.</param> /// <param name="font">The Font.</param> /// <param name="position">The Position.</param> /// <param name="color">The Color.</param> public void DrawString(string text, Font font, Vector2 position, Color color) { var dxFont = font.Instance as DirectXFont; if (dxFont == null) { throw new ArgumentException("DirectX10 expects a DirectXFont as resource."); } _renderTarget.DrawText(text, dxFont.GetFont(), new RectangleF(position.X, position.Y, 9999, 9999), DirectXHelper.ConvertSolidColorBrush(color)); }