How can i rotate a ofTrueTypeFont?

#1

I’m trying to rotate a truetypefont (string). I’m using ofRotate but the string just disappear here is the code. I’m using OF iOS.

ofPushMatrix();
ofRotateZ(45);
ofSetColor(255,0,0);
redblue.drawString(“100”, 400 * scale, 162 * scale);

#2

Hi,
the problem with your code is that it is rotating around 0,0 so what you want to render ends out of the screen.
Check this post where it explains how to deal with it. In it, a rectangle is being drawn but in your case just draw the string at 0,0.
Hope this helps

1 Like