C# Class UHSampleGame.SpriteBatchExtensions

Show file Open project: holtkampw/UH-Sample-XNA-Project

Public Methods

Method Description
DrawInt32 ( this spriteBatch, SpriteFont spriteFont, int value, Vector2 position, Color color ) : Vector2

Extension method for SpriteBatch that draws an integer without allocating any memory. This function avoids garbage collections that are normally caused by calling Int32.ToString or String.Format.

Method Details

DrawInt32() public static method

Extension method for SpriteBatch that draws an integer without allocating any memory. This function avoids garbage collections that are normally caused by calling Int32.ToString or String.Format.
public static DrawInt32 ( this spriteBatch, SpriteFont spriteFont, int value, Vector2 position, Color color ) : Vector2
spriteBatch this The SpriteBatch instance whose DrawString method will be invoked.
spriteFont Microsoft.Xna.Framework.Graphics.SpriteFont The SpriteFont to draw the integer value with.
value int The integer value to draw.
position Vector2 The screen position specifying where to draw the value.
color Color The color of the text drawn.
return Vector2