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 / Spltting an image

Author
Message
Tav
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location:
Posted: 19th Nov 2008 21:35
Is there a way to split an image into several sprites like you do whith CreateAnimatedSprite()?

But I don't want an animated sprite :p. I just have an image from a card deck and want to split the images so that each card becomes a seperate image.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 19th Nov 2008 22:04 Edited at: 19th Nov 2008 22:06
You can draw it to a bitmap, then use dbGetImage(); to grab each card
Let's say you have it 13 by 4.



Or something to that effect. Unfortunately, there is no internal function (that I know of) to do that.


My site, for various stuff that I make.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 20th Nov 2008 01:22
Or, if you can maintain one image and use a sprite for the cards you need to display, use dbSetSpriteTextureCoord (int iSprite, int iVertex, float fU, float fV ).

You'd need to call the function four times to set the percentage of the four corners.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Tav
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location:
Posted: 20th Nov 2008 16:49
thanks

Login to post a reply

Server time is: 2024-11-25 07:59:44
Your offset time is: 2024-11-25 07:59:44