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,
Hello! My first post on the forum. My name is Phantasy, I like fantasy so that is why. I am sure XNA...
By phantasy
XBL Radio.com has put out their roundtable on XNA with myself and a couple of developers. Check it o...
By jimperry
hi Guys another update with the games component for redering bounding box,Spheres , line, the code e...
By tridex
I was wondering, is there a proper way to setup an object in max for export as .fbx to xna?For examp...
By dchin
I released the code of my bsp class its not fully completed but the hard work is done. The rendering...
By perpixel, 1 Comments
Well, I got XNA yesterday and i have been trying to figure out how to use it all day. I have used th...
By daytonadav, 4 Comments
Dear,I Did Installed VC# Express And XNA GSE.Where Can I Found The XNA Tutorials And Help Files?...
By hassanayoub, 3 Comments
Hello all,I'm running the latest Vista Ultimate (MSDN) version on my machine. For some reason I can'...
By ericvanfeggelen, 4 Comments
I "Hear" the XNA Game Studio Express will be available 8/30/06 - (?)Is there a Specific Si...
By echsbachs, 4 Comments
Moved to XNA forum but you should try reposting in the new forums http://creators.xna.com
thezman | Fri, 07 Sep 2007 16:33:00 GMT |
This is ensuring that the character being rendered is one that can actually be rendered. Only certain characters can be rendered - A-Z, 1-0, etc. Special characters cannot be rendered with the code.
jimperry | Fri, 07 Sep 2007 16:34:00 GMT |