Rotating a bitmap
chelneru

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

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.

Thread #613476. Printed from Allegro.cc