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 / Help with rotation

Author
Message
tomaszavenger
15
Years of Service
User Offline
Joined: 24th Jun 2009
Location:
Posted: 16th Oct 2010 17:40
I have a spaceship which I want to remain in the centre of the screen. Centralising it is easy, but then comes the problem with rotation; how do I rotate the object so that its centre is the point of rotation and not the top-left corner.

I use this kind of code for the current rotational system, which I need fixed.



Regards, Tom.
bergice
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 16th Oct 2010 18:30
Quote: "OFFSET SPRITE
This command will shift the position of the drawn image without affecting the coordinate of the specified sprite.
"


To center the sprite use something like this:



Where sprID is the sprite you wanta offset.

51fa1db0ec7c4af52d93a6f5d0e86bc5
tomaszavenger
15
Years of Service
User Offline
Joined: 24th Jun 2009
Location:
Posted: 16th Oct 2010 19:05
This worked; the rotation is around the co-ordinate, which is now in the centre of the ship, so the ship turns in place! Thank you!

Login to post a reply

Server time is: 2024-11-23 07:41:59
Your offset time is: 2024-11-23 07:41:59