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.

Dark GDK / How to rotate sprite in the center of the sprite?

Author
Message
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 4th Jan 2012 13:34 Edited at: 4th Jan 2012 13:41
Hey guys, if you used dbRotateSprite before you know it rotates the sprite using the 0,0 coordinates of that sprite.
But i need to know how can i rotate the sprite in the center of it like the sprite has 40x40, i want to rotate the sprite in the (x,y)=(20,20) so it looks like real.. its possible to do this?

PS: I just remmember that i have the movement and i tried to do in the Update function the dbRotateSprite but it was messed up with the movement..

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 4th Jan 2012 13:45
there was a function to offset the center of a sprite, i don't remember it, maybe dbOffsetSprite, check out the 2d functions in the documentation

vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 4th Jan 2012 18:09
void dbOffsetSprite ( int iSprite, int iX, int iY )
In the X and Y i put the X,Y of the center of that sprite?

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 4th Jan 2012 19:08 Edited at: 4th Jan 2012 19:09
probably, not sure if that's what you're looking for, a try wouldn't hurt though

vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 4th Jan 2012 19:32
I tried and it didn't work but no problem i just use a circle as the player (LOL)

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 4th Jan 2012 19:36
Hey hassan just one thing, in those video tutorials about DX
It says to me Could not init DX ... that error that "we" made to report and stuff.. but its giving me everytime and i have the SDK and everything :S

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 5th Jan 2012 00:54
Here's how I do it:



Hope this helps...

JTK
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 5th Jan 2012 15:34
Whats the gem?

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)

Login to post a reply

Server time is: 2024-04-26 20:51:35
Your offset time is: 2024-04-26 20:51:35