|
pivot_sprite() doesn't seem to work... |
James Stanley
Member #7,275
May 2006
|
pivot_sprite() doesn't work. I would show you a snippet, but it said it wasn't formatted properly . I am trying to use pivot_sprite() to draw the limbs of the players, but it doesn't do anything. It draws it vertically like I drew it in my image editor. Even when I set it to a fixed value (64), it still doesn't pivot it. Any ideas? |
gnolam
Member #2,030
March 2002
|
Yes. Try showing us the snippet again. -- |
James Stanley
Member #7,275
May 2006
|
//Put the correct angle in (I've tested the deg2alleg function) pivot_sprite(bmp, leftua[0], (player->x + headradius + 3), (player->y - (bodylength + 45)), 5, 5, (fixed)deg2alleg((float)player->laa)); //Draw it at 64 Allegro degrees (right angle) pivot_sprite(bmp, leftua[0], (player->x + headradius + 3), (player->y - (bodylength + 45)), 5, 5, 64); Both draw it just like draw_sprite() would. |
Evert
Member #794
November 2000
|
Random guess: you're passing the integer 64 instead of itofix(64). EDIT: damnit, I'm slow! |
James Stanley
Member #7,275
May 2006
|
Wow. That worked. Just trying something else... EDIT: If I pass the following it works right. So I'm happy. Thank you. itofix((int)deg2alleg((float)-player->laa))
|
|