|
allegro 5 c++ draw rotated frame |
bleepBlop
Member #14,822
January 2013
|
I am trying to draw frames which I would then rotate from a bitmap, however, the image only seems to be drawn in the corner of the screen not in the place that the sprite has the position put. My method to draw frames and rotate is : void drawFrame(SPRITE *spr,ALLEGRO_BITMAP *source, int columns) ALLEGRO_BITMAP *bitmap = al_create_bitmap(32,32); It just doesn't seem to follow the actual x at all, it basically goes constantly to 0 width and 0 height, is there a better (functional) way of doing this? My whole code is : http://pastebin.com/XAhf9HAT Thanks for the help. |
Trent Gamblin
Member #261
April 2000
|
Look at the documentation for al_draw_rotated_bitmap again. It says dx and dy are the point where cx, cy is drawn, not the top left.
|
bleepBlop
Member #14,822
January 2013
|
It still seems to just be drawn in the top left corner and only be seen when the x and y goes there, it never stays on the image itself. It's like the x and y (spr->x and spr->y) does not update for the image itself. So I don't know, maybe drawing the frame does not function with then drawing a rotated image? I can't find anywhere any example of someone doing this so I can do some checking. *EDIT: FIXED, read up a bit on it and I was making a mistake while changing the target. |
|