Game Development Community

Text Object Fuzziness Question

by Tom Cassiotis · in iTorque 2D · 10/15/2011 (7:56 pm) · 8 replies

I'm playing around with text objects and I'm finding them very pixelated. I looked at the documentation and the 'hello world' screenshot showed the same issue:

http://docs.garagegames.com/it2d/official/content/documentation/Game%20Builder/images/RainyDay_TextObject_HelloWorld.png

Also the Music Player project has the same problem where it lists the current track.

Do I need to go with sprite fonts?

#1
10/16/2011 (11:53 pm)
The fuzziness can be caused by too low font-setting size for the textObject in the actual level file. Open up yourLevel.t2d in a text editor and look for the textObject. It will have a line that says something like this.

fontSizes = "10";

Try increasing the value for fontSizes. That usually gets rid of the fuzziness for me.
#2
10/17/2011 (6:06 pm)
That worked for me, thanks Simon.

I spent yesterday making some png fonts with some outlining (that look pretty sweet) and figuring out how to get it to work withing iT2D so I'm good both ways.

Saying that, manually editing the text file to set the font size can't be the proper workflow.

I know in T2D/TGB 1.7.5 it just worked. I increased the height of the text object and it did something to automatically pick a proper font size.

Is there something else?
#3
10/17/2011 (11:21 pm)
How did you get the png fonts to work?
#4
10/18/2011 (6:07 am)
This post by Jason Cahill was great (saved me from reading code).

I found and tried A LOT of "bitmap" font generators. I forget which one I chose (I can post it when I get home), but it generated a png with 5 pixel magenta border around letters that I had to deal with.

I played with it with GiMP to leave one row of magenta and move the images to the left edge and after that t2d was able to find the letters.




I had already written some code in TGB to fade-in/out, scale and animate text objects for some quick and dirty effects. The scaling was simply changing the size of the object which increased the font size appropriately. This does not work in iT2D and I can't get it to work well by changing the font sizes. Sooo...

I am going to rewrite this code to work with bitmap fonts. My idea is to mount one letter to the next so that when I enlarge the sprites they will not overlap. If it that doesn't work I'll have to reposition the sprites as they grow.

*Edit to convert url to link
#5
10/18/2011 (11:37 pm)
Also you can set design resolution (120x90) for the scene then add your text. Don't forget to set resolution back.
#6
10/19/2011 (10:26 am)
I'll really need to read the code to see how all the properties relate and are used. (if in doubt look at the code :P ).

Saying that I would consider this a bug. Even if you consider the feature working according to specs and setting the fontSizes is necessary. The situation where you cannot change the value of fontSizes from the editor should be considered a bug. Sure one that can be worked around but still something that should be resolved.

Since I'm doling out work for other people :P ... the media player demo should probably be fixed...
#7
11/30/2011 (3:03 am)
Any more information on this? Did you ever get your idea to work Tom?
#8
01/11/2012 (3:14 pm)
Thank you @SimonAlmqvistPettersson! That saved me a lot of work.