Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sprite rotation

Author
Message
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 19th Sep 2004 04:29 Edited at: 19th Sep 2004 04:38
Hey fellas,

I have a sprite. I want to rotate it on the spot, so that it can face in different directions. When I use the ROTATE SPRITE command, the fulcrum is in the top left corner of the sprite, causing it to rotate out of position on the screen. The sprite therefore spins like a sail on a windmill.

I want to move the fulcrum to the centre of the sprite so that it rotates like a spinning top.

How do I do this?

I'm using DB Pro. In case it helps anyone write some code for me, the size of the sprite is 50x50 pixels.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Sep 2004 10:49
Use the OFFSET SPRITE to adjust the rotation point. It also adjusts its positioning too, so you might need to adjust that.



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 19th Sep 2004 20:25
God damn, that was so simple.

Thanks a lot, I appreciate that. My little soldiers are finally looking in the direction they are running

Login to post a reply

Server time is: 2024-09-23 00:21:59
Your offset time is: 2024-09-23 00:21:59