Game Development Community

Multicolored Text and Text effects

by John Carroll · in Torque Game Engine Advanced · 03/16/2007 (9:32 am) · 3 replies

Hi, has anyone tried to add text effects to the engine. We would like the ability to have white interiors, and black outlines for text. We don't want to do this via font change, since we will be translating our text to many different languages, and we would want the effect to work for any arbitrary font.

About the author

Working on using Torque as an Image Generator for Tactical Simulations under laser and live fire conditions, for Law Enforcement/Military applications.


#1
03/18/2007 (5:36 am)
It should be relatively easy to add a black border, just need to run an edge detection filter on the original font images and add the black. What might take a bit of work is to pad the font glyphs to add space for the border. I took a look at the font code a while back and basically it should be pretty easy to do this as a post process before saving the images out to disk (they are stored as paged PNG's I believe). Basically, look for the place where it writes the font files out and you'll see that it basically writes some image format into the file stream. So munch the images beforehand and write as normal.
#2
04/03/2007 (10:15 am)
Hi, well I wound up adding the material system to text, and wrote a shader that accomplishes this for all characters. This actually makes the text much nicer as we can now apply materials to text, as well as use the vertex/pixel shaders to enhance the text.
#3
04/03/2007 (6:31 pm)
Heh, a very pratical use for shaders indeed ;)