1al_draw_rotated_bitmap(3) Library Functions Manual al_draw_rotated_bitmap(3)
2
3
4
6 al_draw_rotated_bitmap
7
9 #include <allegro5/allegro.h>
10
11 void al_draw_rotated_bitmap(ALLEGRO_BITMAP *bitmap,
12 float cx, float cy, float dx, float dy, float angle, int flags)
13
15 Draws a rotated version of the given bitmap to the target bitmap. The
16 bitmap is rotated by `angle' radians clockwise.
17
18 The point at cx/cy relative to the upper left corner of the bitmap will
19 be drawn at dx/dy and the bitmap is rotated around this point. If
20 cx,cy is 0,0 the bitmap will rotate around its upper left corner.
21
22 · cx - center x (relative to the bitmap)
23
24 · cy - center y (relatice to the bitmap)
25
26 · dx - destination x
27
28 · dy - destination y
29
30 · angle - angle by which to rotate
31
32 · flags - same as for al_draw_bitmap(3)
33
34 Example
35
36 float w = al_get_bitmap_width(bitmap);
37 float h = al_get_bitmap_height(bitmap);
38 al_draw_rotated_bitmap(bitmap, w / 2, h / 2, x, y, ALLEGRO_PI / 2, 0);
39
40 The above code draws the bitmap centered on x/y and rotates it 90°
41 clockwise.
42
44 al_draw_bitmap(3), al_draw_bitmap_region(3), al_draw_scaled_bitmap(3),
45 al_draw_scaled_rotated_bitmap(3)
46
47
48
49Allegro reference manual al_draw_rotated_bitmap(3)