April 25, 2024, 12:36:57 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Rotating a Sprite about a given point.

Started by GWS, April 08, 2013, 01:05:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

Hi,

Here's a test program demonstrating the steps needed to rotate a sprite about given x,y co-ordinates.

Sprites rotate about the centre of their containing rectangle, but are located by the x,y co-ordinates of the upper left-hand corner of the rectangle in the sprite's non-rotated position.

That makes things a bit tricky ..  ::)

Took me a while to figure how to do it, so this program might be of interest if anyone else ever needs to do it.

Program, example sprite,  and .exe attached ..

best wishes, :)

Graham
Tomorrow may be too late ..