private void DrawTextBlockThin(TextSprite textBlock) { Vector2 size = textBlock.Font.Measure(textBlock.Text); float x = (float)PositionForAlignment(textBlock.Position.X, textBlock.Size.X, size.X, textBlock.HorizontalAlignment); float y = (float)PositionForAlignment(textBlock.Position.Y, textBlock.Size.Y, size.Y, textBlock.VerticalAlignment); spriteBatch.DrawString(textBlock.Font, textBlock.Text, new Microsoft.Xna.Framework.Vector2(x, y), textBlock.Color.ToXNAColor()); }
public void DrawTextBlock(TextSprite textBlock) { spriteBatch.Begin(); DrawTextBlockThin(textBlock); spriteBatch.End(); }