SDL_TTF text centering code…
Hi,
I asked about text centering with SDL_TTF.
Well, after a few cups of coffee, I figured it out:------------------------------------------------------------------------------
if (xCenter == true)
{
TTF_SizeText(FntCourier, text, &textWidth, &textHeight);
xScreenPos = (640 - textWidth)/2;
}
Answered my own question.
My SDL based PC Windows Tetris game project:
http://www.silentheroproductions.com/tetribattle3_100percentforpcwindows.htm
(http://www.silentheroproductions.com/tetribattle3_100percentforpcwindows.htm)
(TetriBattle 3 100%[TM])
Jesse “JeZ+Lee” Palser, BS, A+, Network+, MCP
SLNTHERO at AOL.com
Silent Hero Productions ®
"Fun, little games for when you don’t have time to save the world.[TM]"
www.SilentHeroProductions.com (http://www.silentheroproductions.com/)