Game Development Community

RESOLVED - Sharpening jagged text objects

by Pronto Games Engineer1 · in Torque Game Builder · 01/07/2008 (4:24 pm) · 3 replies

I have a lot of text in the game I am working on, and I can't seem to resize any of it without getting jagged lines and it looking awful. Looking around the documentation, I came across this page (http://tdn.garagegames.com/wiki/TGB/Tutorials/Asteroids/Section3) which had this little nugget: "One note: if the score text does not look sharp, you can edit this by going into the .t2d file of your level and changing the "fontSizes" property. For 1024x768 with the given character height of 3, a fontSizes of 31 is used."

I've tried messing around with all sorts of sizes and fontSizes (including arial 3/31 like the tutorial uses, although im using a different res), but I can't seem to get rid of the jaggies. Is there a better way to accomplish this?

#1
01/08/2008 (1:15 pm)
While creating the asteroids tutorial, getting that score text to look right was sadly a case of trial and error. Searching through the forums though, the answer is as follows:

Take your display resolution and divide it by the camera size. In the tutorial example, the display resolution is 1024x768 and the camera size is 100x75. 1024/100 and 768/75 both are 10.24. Take the character height of 3 and multiply that by 10.24 and you get 30.72 which I rounded to the fontSize of 31. Do that for your resolution and camera size and it should look right.
#2
01/09/2008 (10:55 am)
Thanks Mike, that did the trick. An important note - do NOT resize text by click-dragging corners on the text box. You will screw up the width/height proportions and then no amount of fiddling with the fontSize will save you. Change the character height in the edit panel so that it adjusts the width automatically.
#3
01/13/2008 (12:14 pm)
Great info - thanks guys. I was trying to figure this out myself as well...the text never looked good...and now it does. In my case...

800x600 with a camera size of 133x100

lineHeight of 2.7 for the t2dTextObject.

800/133 = 6.015

6.015 * 2.7 = 16.24

rounded to 16 for the fontSizes property.

Previously I had this set to 100 and was relying on lineHeight to scale the size down, but it also made the font look crappy.