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 / Loading a tile sheet with Dark gdk 2d

Author
Message
Kadajett
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 12th Mar 2009 22:55 Edited at: 12th Mar 2009 23:27
I am new to dark gdk, as I am sure all of you can see. I have set my programming team towards dark gdk, because I thought it would speed up development time. Well, it did the opposite. I am stuck on the stupidest problem ever. I know the basic logic on how to load and control a basic sprite sheet. But I do not see where I can clip a texture to display. As anybody that has worked with 2d, to load a specific tile from a tile sheet, you need to display a portion of the tile sheet (based on the size of the tile and the number you select) then you display it to screen. So if the tiles are 32 by 32, and the number of the tile on the tile sheet is 3, then the x = (3 * 32), y = ( 0 ). How would I set the offset of the tile and set it to a texture, or a sprite if necessary (Hopefully it won't be.) Thank you for all your help and your time if you are lacking the first.

http://drunkinninjastudios.webs.com
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 13th Mar 2009 05:41
dbSetSpriteTextureCoord()

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 14th Mar 2009 05:43
Hello i wrote this to get tiles from a graphic image
in this case the image was 6 x 6 and the images are 38 pixels square. Hope this helps u

Regards :- Steve

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA

Attachments

Login to view attachments
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 14th Mar 2009 05:48
oops the images should read 48 pixels square NOT 38 sorry :-(

Steve

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA

Login to post a reply

Server time is: 2024-11-25 17:51:15
Your offset time is: 2024-11-25 17:51:15