i'm using that function to fade objects out (like a diminishing flame) however i want it to shrink towards the middle of the sprite instead of to the bottom (see picture^).
the first thing i tried was something like
sprite.oy -= (original_height - new_height) / 2, then i discovered it's not the sprite but the pixels in it that get increased/decreased.
so then i tried it like this (added to sprite_character):
# subtract the old
self.oy -= @zoom_center
# calc the new
@zoom_center = (self.bitmap.height - (self.bitmap.height * @character.zoom)) / 2 unless self.bitmap == nil
# add the new
self.oy += @zoom_center
self.zoom_x = @character.zoom
self.zoom_y = @character.zoom
but now it drops down to the bottom of the sprite rect, slowly goes up to the middle and drops down again to where zoom_x originally made it end up.O_O
this is the most logical way i could think of, and all other attempts have slowed the dropping down but still ended up at the bottom.