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.

DarkBASIC Professional Discussion / How does one use Sync Commands correctly?

Author
Message
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 1st Sep 2003 06:08
I've asked this in the Newbie section, and received aid from CattleRustler. He gave me this code to show how to use the Sync commands:
sync on
sync rate 100
backdrop off

intLoop as integer

For intloop=0 to 100
set cursor 0,0
print str$(intloop)
sync
wait 1000
Next intloop

However, when ran, all the numbers would be all mushed togther thus leading a nasty white mark where there should have been numbers. CattleRustler himself was surprised when the same happened on his pc, when he had used simialr code for his own reasons and it worked. He said to ask around, and this seemed the most logical next place to ask.

So as to provide reference here is a link to the orignal post:
http://darkbasicpro.thegamecreators.com/?m=forum_view&t=16042&b=7
All help appreciated!
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 1st Sep 2003 06:32
If you set the backdrop off, you're not clearing the screen so the FPS print outs are just printing over the top of each other. SET BACKDROP ON should sort it out.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 1st Sep 2003 06:36
Wow, that did it. But, out of curiousity, why do most programs turn the backdrop off?
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 1st Sep 2003 06:42
If you have 3D objects completely covering the screen then when the screen is updated, those 3D objects are drawn over the old images of the 3D objects. If you dont have the screen full of 3D, then any areas that arent drawn to when the screen is refreshed will show what was there before. Meaning a 3D object will leave a trail behind it.

Seeing as most programmers have the screen full with the land and a sky sphere etc etc. no empty areas exist, so the backdrop isn't needed to clear stuff up.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 1st Sep 2003 06:45
Than I'll have to remember that when I change from a Text-based Rpg to a 3d-Based Rpg, once I learn how to draw something fancier than stick-models(Darn my lacking artist skills!) thank you for your aid, Fallout!
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 1st Sep 2003 12:19 Edited at: 1st Sep 2003 15:17
you could also use the "set text opaque" command and that would make your text legible, it overwrites the areas of the text that would be black in the background, although if the length of the text varies you have to append something like "..." onto the end to clear any trailing text from a previous write.

Mentor.
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Sep 2003 22:41
Ahh, I get it now. I was thinking in 3d - LOL sorry Usermlsra


-RUST-

Login to post a reply

Server time is: 2026-07-24 00:18:47
Your offset time is: 2026-07-24 00:18:47