Hey guys. It's been a while since my last lurk, but I'm back with a question regarding OFFSET SPRITE.
I'm creating an animated intro sequence for my latest game project to tell its story - you know, opening credit sequence with a series of slides and overlaid text to tell the story.
I'm using a series of fullscreen images, loading them in one at a time and displaying them, then manipulating them in minor ways for the purpose of animation, such as slowly zooming in on the center of the image, or zooming out, or using a very wide image and scrolling it slowly to the left to pan across the image. Simple stuff.
So I'm using the following code to create, manipulate and then draw the image:
sprite 1, 0, 0, slidenum
hide sprite 1
size sprite 1, screen width(), screen height()
offset sprite 1, int(sprite width(1)/2), int(sprite height(1)/2)
scale sprite 1, slidesize
paste sprite 1, slidex, slidey
Most of this should be self explanatory: Create the sprite and immediately hide it. Resize it to the size of the screen (which is variable, determined by an external .ini file at boot). Offset to the centre of the sprite so that I can always draw it to the same coordinates regardless of its scale. Then change that scale for the purpose of zooming in or out over time. Then actually paste the finished product to the screen.
Now, if I *omit* the scale command, everything works as expected - the image will be resized to fit the screen and drawn to its exact center, filling the screen perfectly with the image.
If I include the scale command, I get an odd result: The image seems to scale correctly but the offset is no longer correct - check it out:
Without SCALE
With SCALE
If I perform the SIZE and SCALE commands before the OFFSET, the image seems to be offset far outside the bounds of the image itself, like +2000 in each dimension.
My question then, is what are the rules of offsetting an image? What can I and can't I do to a sprite after it's been offset without messing up the offset?