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.

DarkBASIC Professional Discussion / Rotating a sprite around it's center?

Author
Message
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 2nd Jun 2011 02:25
Hi! I was wondering how I could rotate a sprite around it's center.

I noticed when I set up a game to rotate a sprite, it rotates it around the first point of the image. Is there a way I could have the sprite rotate around it's center (since I'm using 32x32 sprites, that would be like... XOffset+16, YOffset+16).

Thanks!
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 2nd Jun 2011 05:41
Check out command offset sprite I think it does what you're asking for.


A 3D marble platformer using Newton physics.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Jun 2011 13:51 Edited at: 2nd Jun 2011 13:59
Yepp, that's the one. It changes the pivot point of the sprite, just offset it to the middle of the sprites x znd y co-ords.
@ tiresius, I noticed our making a marble madness style game. I have a part way project of pretty much the same thing myself, but using Dark Physics, or a version of it anyway. I have it on pause at the minute as I had come to the stage where I needed to rewrite a good chunk of the editor ,due to a total change needed with the objects to get the physics animations working. I thought a break would be best as it was beginning to annoy. Hope your project is more successful! I do plan to return to it myself at some point. For now I'm playing around with a 2D simple project for appup.

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2026-07-11 02:14:18
Your offset time is: 2026-07-11 02:14:18