Rotating Text
Frankincense

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?

J-Gamer

With A5, this is pretty easy to do:

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

SiegeLord

Transformations will work fine too:

#SelectExpand
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);

Frankincense

Brilliant, it worked perfectly, cheers guys :)

Thread #610417. Printed from Allegro.cc