- Online Community Forums » Programming Questions » Rotating Text

This thread is locked; no one can reply to it. rss feed Print
Rotating Text
Member #14,367
June 2012

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?

Member #12,491
January 2011

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

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

Member #7,827
October 2006

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

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Member #14,367
June 2012

Brilliant, it worked perfectly, cheers guys :)

Go to: