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.

Newcomers DBPro Corner / Loading a 2D tile from a bitmap

Author
Message
MaPo
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location: Machu Picchu
Posted: 11th Sep 2008 07:58
Hi all,

I am looking for a clean, fast way to select individual tiles from a bitmap. I made a bitmap that has all tiles I need. Tiles are 32x32. After digging around, I came up with the following. Is this a good way to do it? I notice that upon run the whole bitmap flashes rather quickly and then the screen clears and my desired tile is displayed. I\'ll be honest here, I don\'t understand why the SYNC stuff has to be in here. I got it from others who have posted similiar.

It works, but something about this code bugs me. Could someone who knows 2D tile-work take a look?
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 11th Sep 2008 14:52
Try not to load your bitmap on bitmap 0, and then, don't forget to use the Set Current Bitmap command.

I haven't tested it, but I think it should work :


MaPo
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location: Machu Picchu
Posted: 13th Sep 2008 05:22
Thanks Math89, the code makes sense.

Login to post a reply

Server time is: 2024-11-25 17:55:44
Your offset time is: 2024-11-25 17:55:44