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 / Center of Sprite

Author
Message
Timatron
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Dec 2009 02:30
I wanted to make my crosshair in the middle of my window, except when I use dbSprite(5,dbScreenWidth()/2,dbScreenHeight()/2,6)
it works, but its not the center of the screen because its moving the top left of the image to the center of the screen, how would I be able to put the center of the image in the center of the page?
Thanks!
-Tim
Dragon_Soldier
14
Years of Service
User Offline
Joined: 2nd Dec 2009
Location:
Posted: 7th Dec 2009 02:52
OK,
I'm new to DarkGDK but I think I may know a solution.Find out the width and height of your image (in pixels) then plug it in to your line.
As in:
dbSprite(5,dbScreenWidth()/2 - (put width of image/2 in here), dbScreenHeight()/2 - (same as width but height), 6)

Hopefully this works.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 7th Dec 2009 03:13
dbOffsetSprite(dbSpriteWidth(Sprite) / 2, dbSpriteHeight(Sprite) / 2)

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Timatron
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Dec 2009 03:28
Thank you!

Login to post a reply

Server time is: 2024-11-19 09:05:36
Your offset time is: 2024-11-19 09:05:36