public DrawString ( |
||
spriteFont | A font. | |
text | StringBuilder | The text which will be drawn. |
position | System.Vector2 | The drawing location on screen. |
color | System.Color | A color mask. |
rotation | float | A rotation of this string. |
origin | System.Vector2 | Center of the rotation. 0,0 by default. |
scale | System.Vector2 | A scaling of this string. |
effects | SpriteEffects | Modificators for drawing. Can be combined. |
layerDepth | float | A depth of the layer of this string. |
return | void |
public void DrawString (
SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color,
float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth)
{
CheckValid(spriteFont, text);
var source = new SpriteFont.CharacterSource(text);
spriteFont.DrawInto(this, ref source, position, color, rotation, origin, scale, effects, layerDepth);
}
SpriteBatch::DrawString ( |
|
SpriteBatch::DrawString ( |
|
SpriteBatch::DrawString ( |
|
SpriteBatch::DrawString ( |
|
SpriteBatch::DrawString ( |
public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) { if (mask) { string maskVaue; if (value < 10) { maskVaue = "000" + value.ToString(); } else if (value < 100) { maskVaue = "00" + value.ToString(); } else if (value < 1000) { maskVaue = "0" + value.ToString(); } else { maskVaue = value.ToString(); } spriteBatch.DrawString(font, maskVaue, position, Color.White, 0, new Vector2(), fontSize, SpriteEffects.None, 0f); } else { spriteBatch.DrawString(font, value.ToString(), position, Color.White, 0, new Vector2(), fontSize, SpriteEffects.None, 0f); } }