Corrupted Text via t2dTextObject
by Joe Virgin · in iTorque 2D · 12/17/2009 (4:48 pm) · 1 replies
I'm creating a t2dTextObject using Torque's built in Arial 15 (ansi).uft font file and it works well when testing in the editor, but when I put it on the iPhone, the text appears corrupted as if random pixels were taken out of the displayed text. I tried making the font larger and I got the same results. Here's the code I used to create the text object:
Any ideas or suggestions?
new t2dTextObject(testText) {
canSaveDynamicFields = "1";
Position = "0 0";
size = "205 45";
UsesPhysics = "0";
text = "This is a test";
font = "Arial";
wordWrap = "1";
hideOverflow = "0";
textAlign = "Left";
lineHeight = "15";
aspectRatio = "1";
lineSpacing = "0";
characterSpacing = "0";
autoSize = "1";
fontSizes = "15";
textColor = "1 1 1 1";
hideOverlap = "1";
mountID = "47";
};Any ideas or suggestions?
About the author
Joe Virgin is a programmer for Plainvue Software, Inc., a company producing iPhone games that teach math skills to the youth. Check out Fraction's Kitchen Lite, Fortune's Prime, and Chainshooter powered by iTGB and now available on the App Store.
Associate Luke Lamothe
Luma Arcade
This filtering is made even worse if your text is not located on a pixel boundary (ie. you are drawing it at X location 13.2 instead of 13).
If you are using 1.3 Beta, you can use the following parameters to help with the funiness:
These enable linear filtering on text objects, as well as pixel clamping so that the text location gets rounded to the nearest pixel. These are just by projects of computer graphics that developers need to deal with unfortunately :)