Hi all,
i finded xna "XNA Onscreen Keyboard Component" sample in internet(http://www.xnaresources.com/pages.asp pageid=27). What does the iFontAsciiStart and iFontAsciiEnd mean in function WriteText () Please somebody help. Below is the function coding.
public void WriteText(SpriteBatch spriteBatch, string sTextOut, int x, int y, Color colorTint)
{
// Very simple text output method. Uses a mono-spaced font to keep things easy
int iFontX = 0;
int iFontY = 0;
int iFontHeight = 30;
int iFontWidth = 19;
int iFontAsciiStart = 32;
int iFontAsciiEnd = 126;
int iOutChar;
for (int i = 0; i < sTextOut.Length; i++)
{
iOutChar = (int)sTextOut
;
if ((iOutChar >= iFontAsciiStart) & (iOutChar <= iFontAsciiEnd))
{
spriteBatch.Draw( t2dFont,
new Rectangle( x + (iFontWidth * i), y, iFontWidth-1, iFontHeight),
new Rectangle( iFontX + ((iOutChar - iFontAsciiStart) * iFontWidth),
iFontY, iFontWidth-1, iFontHeight),
colorTint
);
}
}
}
Best Regrads,