Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Rotating a bitmap

This thread is locked; no one can reply to it. rss feed Print
Rotating a bitmap
chelneru
Member #15,378
November 2013
avatar

Hi
I have visual problem with al_draw_rotated_bitmap.
This is my code :
al_draw_rotated_bitmap(circle, positioncircle.x * SCALE, positioncircle.y * SCALE, positioncircle.x* SCALE, positioncircle.y * SCALE anglecircle, 0);

I want to view on the screen a box2D body. I put the cx and cy equal to dx and dy because I don't want to appear the rotated version somewhere else .
The problem is that i only see the circle standing there at his coordinates . The physical body is falling but the image remains freezed . How should i write correctly ?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Look at the docs for al_draw_rotated_bitmap. It says cx and cy are on the source bitmap, and that point will be drawn at dx,dy with the rest rotating around it. cx and cy are typically the center of your source bitmap. And I don't know why you're multiplying by scale there. Look into using Allegro's transformations.

Go to: