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 / problems with dbOffsetSprite

Author
Message
Mr Squishy
18
Years of Service
User Offline
Joined: 25th Feb 2006
Location:
Posted: 18th Mar 2006 18:01
How does this command work?
It does not do what i expect it to.
does it take into account the orrigional position of the sprite.
why do positive numbers display the sprite off screen, while negative x and y offset it on screen but not by the values you set.
how do you use this command?

Some days the cascading moments which constitute my experience dissolve to reveal a sense of clarity which transcends reasoning.
And then there are days like today.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 18th Mar 2006 20:12 Edited at: 18th Mar 2006 20:28
read the help:
Quote: "
dbOffsetSprite
This command will shift the position of the drawn image without affecting the coordinate of the specified sprite. You can use this command to change the visible sprite in relation to the coordinates you use to position it.

Syntax
void dbOffsetSprite ( int iSprite, int iX, int iY )

Related Information
SPRITE Commands Menu
Index

"


edit: or did you know that already?

Mr Squishy
18
Years of Service
User Offline
Joined: 25th Feb 2006
Location:
Posted: 19th Mar 2006 06:37
Has anyone used this command before?
Well its wack.

I just figured out that i should use dbSprite to position sprites so i guess i didnt need it anyway.

Thanks though.

Some days the cascading moments which constitute my experience dissolve to reveal a sense of clarity which transcends reasoning.
And then there are days like today.
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 20th Mar 2006 13:26
I never used it but I think it works this way:

-you position your sprite at 10, 10
-It will show at 10, 10

-you set dbOffsetSprite 1,1
-you position your sprite at 10, 10
-It will show at 11, 11

May this helps, though, I didnt tried that commands...

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;
Mr Squishy
18
Years of Service
User Offline
Joined: 25th Feb 2006
Location:
Posted: 25th Mar 2006 20:38
Smithy you are pretty much right

dbOffsetSprite is so that you can set the "anchor point" of the sprite for like rotations and stuff.

int deg=0;
dbOffsetSprite (1, dbSpriteWidth()/2, dbSpriteHeight/2);
dbRotateSprite(1,++deg);

and now it will spin around the center instead of around the top left corner.

Some days the cascading moments which constitute my experience dissolve to reveal a sense of clarity which transcends reasoning.
And then there are days like today.
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 25th Mar 2006 22:18
That's useful, another peice of information. I remeber writing a rotating "missile" in DBpro I had not got around to figuring out how to change it's offset. This will help me out allot thanks!

There are many answers but just one question" ~ Jerilith the Mad

Login to post a reply

Server time is: 2024-11-19 05:27:02
Your offset time is: 2024-11-19 05:27:02