#10465 - poslundc - Fri Sep 05, 2003 9:08 pm
OK, so I have a situation where I want to create a sense of perspective by showing a sprite smaller if it's further away from the player and larger if it's closer.
The problem I'm having is that the sprite's coordinates in OAM represent the upper-left corner of the sprite, and as I scale the sprite downwards it shrinks towards the centre of the 32x32 area the sprite holds. This means that if I want to keep the character's "feet" planted on the same y-coordinate, I need to manually adjust the y-coordinate of the sprite.
Even worse is if I scale the sprite upwards, in which case I need to invoke SIZE_DOUBLE and adjust both the y-coordinate and x-coordinate by (dimension / 2) just to keep the new sprite centred over the old sprite.
I can do all of this if need be... I'm just wondering if there's a better way. For that matter, is there any penalty if I decide to just leave SIZE_DOUBLE on for the sprites that need scaling (it'll be about 20 sprites altogether)?
Thanks,
Dan.
The problem I'm having is that the sprite's coordinates in OAM represent the upper-left corner of the sprite, and as I scale the sprite downwards it shrinks towards the centre of the 32x32 area the sprite holds. This means that if I want to keep the character's "feet" planted on the same y-coordinate, I need to manually adjust the y-coordinate of the sprite.
Even worse is if I scale the sprite upwards, in which case I need to invoke SIZE_DOUBLE and adjust both the y-coordinate and x-coordinate by (dimension / 2) just to keep the new sprite centred over the old sprite.
I can do all of this if need be... I'm just wondering if there's a better way. For that matter, is there any penalty if I decide to just leave SIZE_DOUBLE on for the sprites that need scaling (it'll be about 20 sprites altogether)?
Thanks,
Dan.