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 / Dark Basic text problem

Author
Message
GAMELMPR
14
Years of Service
User Offline
Joined: 21st Feb 2012
Location: Helsinki
Posted: 27th May 2012 14:30
I have this problem in DarkBasic: Numbers showing on screen don't erase previous numbers and they come on top of each other. So it goes a unreadable mess. How to erase this problem?

Source code attached to this message.
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 27th May 2012 16:38
not sure what you mean..
but once u dealing with 3d object, u have to put SYNC in your loop
but if its only text, no sprites, u can use CLS command instead.

do
cls
a = a+1
text 0,0,"My A: "+str$(a)
Sleep(100)
loop

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 27th May 2012 16:41
try cls at the start of every program loop. that will clear the old text and rewrite the fresh text.

Sometimes I like to use words out of contents
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 27th May 2012 16:52
Or use: SET TEXT OPAQUE
GAMELMPR
14
Years of Service
User Offline
Joined: 21st Feb 2012
Location: Helsinki
Posted: 27th May 2012 19:35 Edited at: 27th May 2012 19:56
Scraggle: Your advice worked. Thanks for your advice. I will put more code soon when I program more.

That CLS command makes screen only flicker. No good.
Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 27th May 2012 23:39
Screen flicker? I think that's caused by not taking control of the sync. You do this by putting SYNC ON at the beginning of your code. Setting text to opaque is just a band-aid. If the string printed becomes smaller than what was printed last loop, the edge of the text would be visible past the end of the current string.

Definitely try using sync on, and putting sync at the end of each loop.

Good luck.
-Amo.

Login to post a reply

Server time is: 2026-07-22 00:35:38
Your offset time is: 2026-07-22 00:35:38