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 / dbSprite resizing sprite

Author
Message
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Aug 2009 13:28
Twice in one night. Ok I am haing a problem with dbSprite.



The sprite appears in the right place it is just streatched really large. I am scratching my head trying to figure out why placing my sprite is causing it to streatch.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 11th Aug 2009 13:41
Could spos be getting calculated to be out of bounds of the current screen area ? do sprites "wrap" around if you do that with their co-ords ?

I mean, provide 1 co-ord that is inside screen area, and one that is outside(ie negative) ... could that be the cause of your sprite warping ?

I havent done alot with sprites so im not 100% sure of their behaviour in that kind of situation, but the sprite command doesnt look like alot can go wrong with it really, a sprite number, 2 co-ords and an image number...

Your image isnt being corrupted at all somewhere along the line ?

just thinking out loud... good luck, thats a strange one for sure lol

If it ain't broke.... DONT FIX IT !!!
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Aug 2009 13:51
Yeah I am not sure...

Well I think it has something to do with the create animated sprite function. I am using an image 800x1580, 1x20 frames. When I call dbSprite it sets the sprite to frame one and scales it to the size of the image (800x1580)

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 11th Aug 2009 13:55 Edited at: 11th Aug 2009 13:56
ahhh yep that would be correct, I think with sprites you can change their UV co-ords can you ? if you want to use jsut a part of an image for the sprite...



Also, you can use dbPasteSprite, to paste an existing sprite to a new position, rather than create a new one which is what dbSprite does.

Have a look through the DarkSDKSprites.h header files, there are a few interesting commands in there.

EDIT : you would need to call that command 4 times to keep the sprite square, a sprite has 4 vertices.... top left, top right, bottom left and bottom right....

If it ain't broke.... DONT FIX IT !!!
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Aug 2009 14:21
I am just setting the sprite up right now. I hate the fact that the documentation is so vague about everything.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";

Login to post a reply

Server time is: 2024-10-01 10:25:33
Your offset time is: 2024-10-01 10:25:33