Mail Archives: djgpp/1997/02/15/07:39:51
Calvin French writes:
>Hey Shawn one more thing. There is still a slight "glitch" in the
>sprite rotation function. This is simple to fix though. Anyways,
>shouldn't the sprite rotation function rotate the sprite *about* the
>x|y coords it is passed, not rotate the sprite with the ulc there?
I'm not sure this is a bug: maybe more of an obscure "feature" :-) If I
was designing it from scratch today, I would certainly use the position
as the centre of the rotation, but I don't think I should change it now,
because that would break too much code.
My original thinking was that calling rotate_sprite() with a zero angle
of rotation should be identical to draw_sprite(). If you prefer to
specify the centre position, it's easy enough to write a wrapper that
subtracts half the sprite width from the x position, and half the sprite
height from y...
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
*/
- Raw text -