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 / Backdrop

Author
Message
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 23rd Jun 2009 00:30 Edited at: 23rd Jun 2009 07:49
Hello, i am trying to create a backdrop for my game. I want it to work exactly like the default 2D Game project. I have it working perfectly but i have to put the backdrop in my loop. I really don't want to do that. But if i put it before the loop it never displays. I think my screen is updating and deleting it. Now im trying to load tiles for a map into my game. But all the tiles will just disappear unless i put them in the loop, i don't want my map to be repeatedly loaded forever.

So, basically how would i load a backdrop. Not in a loop. The default example has it working but it wont for me.

my code is below. Sorry for the giant mess of code, but i cant tell myself where my screen is clearing.

[removed]

Thanks for any help i receive.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 23rd Jun 2009 02:27
Would you expect otherwise? You pretty much have to redraw things in order to wipe out the previous write. If you're concerned about having to call the drawing of the background just make it a sprite with a higher priority than the other sprites. Then running dbSync(), which you'll need to do anyway, will take care of making sure the background is drawn before the rest of the sprites.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 23rd Jun 2009 07:01
Well the default example has a backdrop thats not in a loop and it works fine, guess its unavoidable though. Guess ill have my map remake every second. Just seems like a weird idea.

Thanks anyway.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 23rd Jun 2009 15:14 Edited at: 23rd Jun 2009 15:14
Quote: "Well the default example has a backdrop thats not in a loop and it works fine, guess its unavoidable though. Guess ill have my map remake every second. Just seems like a weird idea."



Did you read what I said? Your backdrop is a freaking sprite.

dbLoadImage ( "backdrop.bmp", 1 );
dbSprite ( 1, 0, 0, 1 );

The only reason it's not mentioned again in the loop is because there's no need to change either it's position or its frame. All sprites are redrawn when dbSync() is called. As long as they're not hidden or off-screen, all sprites are redrawn.

Quote: "Thanks anyway. "


Hey! Any time.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 23rd Jun 2009 19:11
Ahhh, thank you now i understand. Sorry if i came off rude.

Login to post a reply

Server time is: 2024-10-01 06:04:46
Your offset time is: 2024-10-01 06:04:46