View Full Version : Rotated text on HUD

11-29-2007, 12:18 PM
Did anyone figure out yet how to draw rotated text onto the HUD?
In previous engine generations you could draw text to a ScriptedTexture and somehow put that onto the HUD (TexRotator or some rotated sheet actor in front of the player), but UT3 doesn't seem to have ScriptedTextures anymore.

11-30-2007, 01:03 AM
native final function DrawRotatedTile( Texture2D Tex, rotator Rotation, float XL, float YL, float U, float V,float UL, float VL, optional float AnchorX, optional float AnchorY);

native final function DrawRotatedMaterialTile( MaterialInterface Mat, rotator Rotation, float XL, float YL, optional float U, optional float V, optional float UL, optional float VL, optional float AnchorX, optional float AnchorY);

found those in the canvas class. might be of use to you

11-30-2007, 02:57 PM
That'd mean I'd have to draw each character individually - not exactly what I had in mind.

11-30-2007, 03:13 PM
I bet you can't make a new texture out of a string of text? :P

11-30-2007, 03:45 PM
Nah, those two words only look similar. ;)

11-30-2007, 08:02 PM
Oh god, I just noticed something.
This is how the Flak Cannon ammo counter works:

/me shudders

11-30-2007, 08:07 PM
Slot machine!

11-30-2007, 08:08 PM
LOL That's funny

11-30-2007, 08:10 PM
And soon, the casino and brothel mod shalt be made.

11-30-2007, 08:49 PM
rofl... i guess thats one way to do it

11-30-2007, 09:03 PM
Yes, but just how desperate do you need to be to do something like this?

11-30-2007, 11:49 PM
Haha, that's priceless.

Got to give them points for ingenuity there, that's a clever hack :)

EDIT: There does not appear to be a good 'non-hacky' way of drawing rotated text on the HUD; you could put in a request for a future patch to allow you to attach a canvas to a TextureRenderTarget2D, so that you can simulate scripted textures (I'm not sure why you aren't already able to actually).

I'm not sure how difficult that would be to code, but it would be infinitely useful as it could also be used to cache parts of HUD rendering (esp. the radar map, among other things) and thus speed up performance.

12-01-2007, 12:00 AM
That's not a hack, that's the artists insisting that it would be cooler if you could see the numbers animate when you fired. Of course, then they made the firing animation have enough kickback to put the ammo counter offscreen. :P


The Canvas supports a transformation matrix that would let you draw arbitrary rotated stuff, but we only exposed the translation part to script. Oops. I will try to get it added for a patch, but it's highly unlikely it will make the first patch.

12-01-2007, 12:03 AM
Ah, yes that makes sense :) Check my edit above, it would be nice to see a feature like that in a future patch too.