|
Rotating Text |
Frankincense
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? |
J-Gamer
Member #12,491
January 2011
|
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
" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
SiegeLord
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 |
Frankincense
Member #14,367
June 2012
|
Brilliant, it worked perfectly, cheers guys |
|