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 / Hiding screen contents with a twist.

Author
Message
Mister Fuzzy
13
Years of Service
User Offline
Joined: 27th Feb 2011
Location: XNA
Posted: 28th Oct 2011 06:16
Hmmm... I've run across a problem with the tileset loader I'm working on... My tile reader views an image with the colors RGB 0,0,0 to RGB 0,0,255, to give me 256 possible tiles to load as a map (That's a considerable amount! But they don't ALL have to be used...). While the map loads, however, the user can see the map file for a aecond or two. I don't want this!!! How can I get the screen to be blank ( or at least a small "Loading" image ) without messing up the dbPoint(X,Y) command?!?

Tunnel vision yet? Have a carrot!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 29th Oct 2011 13:23
Turn on sync and don't call use dbSync() while loading.
Having dbSyncOff causes it to sync on its own at regular intervals.

Also you can paste a sprite (or just an image) over the entire screen while loading, for example a loading animation (in which case you will have to sync to update that, but it will cover whatever is behind it).


"Why do programmers get Halloween and Christmas mixed up?"
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 29th Oct 2011 14:25
You don't need to use dbPoint to read the contents of an image. Convert it to a memblock and then you can read the values of pixels without ever putting the image on the screen. Here is a post which explains the structure of an image memblock. If you type "memblock" into the search field of the Dark GDK help, you will find the commands related to it.

http://forum.thegamecreators.com/?m=forum_view&t=122796&b=1
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 29th Oct 2011 14:38
Oh shoot, didn't read your post properly.
Mireben is right and that would be the preferred way of doing it. If you still want to use the dbPoint function you should be able to paste the image either off-screen (ie. at negative coordinates) or to another bitmap (dbCreateBitmap(), dbSetCurrentBitmap()). Point is way slower than memblocks though


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2024-10-02 21:31:52
Your offset time is: 2024-10-02 21:31:52