Game Development Community

Font rotation borked?

by Bryce "Cogburn" Weiner · in Torque Game Engine Advanced · 09/24/2007 (7:54 pm) · 0 replies

I'm sure this is a known issue, but I've been taking a crack at trying to solve it. I just can't seem to stop tinkering w/ TGEA. :)

To summarize: Font rotation via engine doesn't work... This code:
F32 rot = -90.0f;
	GFX->drawText(mFont,fontHere,mCaption,mProfile->mFontColors,9,rot);

... produces no discernible results. The area where the text should be is blank, and expanding the bounds of the control do not reveal the text.

The whole font render batcher is still pretty alien territory to me, so I could be tilting a windmills. I've rewritten the render function in FontRenderBatcher to work similar to the TGE version, but with no results.

I'm just not understanding where the failure is. I mean... regular text works fine, so the problem must be in the rotation itself... but that is just fine given it's pretty straight forward...
rotMatrix.set( EulerF( 0.0, 0.0, mDegToRad( rot ) ) );

...

	point.set( screenLeft, screenBottom, 0.0f );
	rotMatrix.mulP( point, &verts[currentPt].point );
	verts[currentPt].color = m.color;
	verts[currentPt].texCoord.set( texLeft, texBottom );
	currentPt++;

So now the only difference in the code between TGE and TGEA is the added FRB. I'm starting to suspect it's in queuing the characters that things are going pear-shaped. A non-transformed X coordinate is supplied which would seem to indicate a "virtual" position of the character within the string, except that it derives from the supplied point to be rendered on the screen... and is then incremented according to the width of each character.

But why would that affect the actual rendering process when the triangles themselves are rotated? Am I missing a connection between the queuing and rendering of the FRB?

Maybe I've been looking at this too long but I'm just stumped.