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 / Sprite size not image

Author
Message
Xzod
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 11th Feb 2009 14:12
hello

i would like to change sprite size without affecting the image size that is in it. so if the sprite is smaller than original image, the part of image that outbound the sprite size limite become not visible according to a direction i give to it (a bit like canvas size in photoshop). i couldnt find function, is it possible to do that ?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Feb 2009 18:57 Edited at: 11th Feb 2009 18:59
dbStretchSprite
dbSizeSprite
dbScaleSprite

All three functions are detailed in the help file.

[EDIT]
Looks like I may have misread the question a little, but then it's not really clear - do you want to change the sprite size without scaling the image it uses?

Xzod
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 11th Feb 2009 20:49
dbStretchSprite
dbSizeSprite
dbScaleSprite

those commands won't do what i want to do.

please take look at attached picture, you may understand what i want to do

first one is the original sprite, the 3 others are the resize i want to do (i just put 3 for the example but in real i may need to do it around 500 times)

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Feb 2009 21:17
Yes, you want what I suggested in my edit, and to be honest, I'm struggling to come up with a method of doing that with sprites.

The best I can suggest right now is that you use a secondary bitmap containing your image (maybe you dbPasteImage to that bitmap), and use dbCopyBitmap to copy the bit you are interested in to the main display bitmap.

Xzod
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 11th Feb 2009 21:55
so i can guess from your answer that no methods are provided to do that. i'm trying to do is
a scanning machine, the plain person sprite is covered by the skull sprite and scanning device sprite go from top up to down, while its going down the skull become like in the attached picture and the plain person start to show up.

as far as i saw bitmap wont be seen on screen if sprites are on it, so i must rewrite all my sprites of scan machine in bitmap copy/paste method on bitmap, that is lot of work

i think i will cheat by using dbCreateAnimatedSprite(x, "x", 1, 500, x), and seting the frame i want, and doing that 500 times in loop, faster to do than rewriting all my scan machine

thank you for the help
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 12th Feb 2009 22:41
Culling out portions of an image to use as a sprite is just a matter of using dbSetSpriteTextureCoord(). Although not obvious it's rather simple. However, it requires invoking the function four times for each time you want to reset all for corners.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office

Login to post a reply

Server time is: 2024-09-30 17:27:40
Your offset time is: 2024-09-30 17:27:40