Rotating Text

Hi guys,

I want to try to rotate some text. To do this it might be best to put the text into a bitmap, and rotate that. But I have no idea how I could get text into a bitmap.

Any ideas?


With A5, this is pretty easy to do:

//draw the text
al_set_target_bitmap(al_get_backbuffer(al_get_current_display())); //reset the target bitmap


Transformations will work fine too:

1ALLEGRO_TRANSFORM old, new; 2 3/* Save the current transform */ 4al_get_current_transform(&old); 5 6/* Create the new transform and use it */ 7al_identity_transform(&new); 8al_translate_transform(&new, -cx, -cy); 9al_rotate_transform(&new, angle); 10al_translate_transform(&new, dx, dy); 11al_use_transform(&new); 12 13/* Draw text at 0,0 as the transformation takes care of the positioning */ 14al_draw_text(font, color, 0, 0, 0, "blah"); 15 16/* Reset the old transformation*/ 17al_use_transform(&old);


Brilliant, it worked perfectly, cheers guys :)

Thread #610417. Printed from