Game Development Community

Advice on using t2dTextObjects?

by Justin Proffitt · in Torque Game Builder · 08/02/2011 (6:53 pm) · 4 replies

I have decided to start adding gui components to my project, and I noticed that t2dTextObjects are particularly.. finicky when it comes to rendering them. Depending on where I place them and what font is being used and in what order the characters within are arranged, there can be problems such as bleeding and aliasing. So I was curious if anyone who has worked with text in torque might be willing to impart some useful advice or tips on using them so they don't look horrendous?

I would be very grateful and I have a feeling many others would be too!

About the author

I am a college student majoring in physics. As it so happens I like programming, a hobby which extends my profession in web design.


#1
08/04/2011 (1:38 am)
I'm yet to look closer at how textObjects are rendered and why such simple task gives so much trouble, but so far I just using textObjects with snapToInteger set to "1" and no rotation, and the result is somewhat acceptable. You'll also want to make sure that lineHeight of the text object matches font size it is using, and it's aspectRatio is 1.0
#2
08/04/2011 (10:11 pm)
Thank you, I am meticulously placing them to minimize issues. I think I figured out why the bleeding occurs: the t2dTextObjects don't have pads like imagemaps, so they sample the characters next to them. So I really hope someone in garage games picks up on that before their next release.
#3
08/05/2011 (12:25 pm)
We recently discovered this bug via an iTorque 2D post. We noticed slight bleeding when a lot of t2dTextObjects were placed in the scene. We are logging it as a bug, but I do not have an ETA on a fix. In general, I tend to discourage the use of t2dTextObjects in iTorque 2D projects.

I know they are more stabled with Torque 2D, but they still face similar usability issues with stretching and caching.
#4
08/05/2011 (12:59 pm)
Thanks for the notice! Right now my only problem with them is the bleeding; I can get around the font caching and have no reason to manipulate their dimensions.

Perhaps someone will post a fix that does the same padding thing to them as image maps, or I can modify my font to have a couple extra pixels of space between characters.