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 / Yet another newbie question.

Author
Message
Dante Corwyn
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location:
Posted: 19th Mar 2003 12:33
Okay. While trying to write some code that would let me see the x and y coordinates of the mouse, I came up with the following.

cls
do
set cursor 10,10
print " "
x=mousex()
y=mousey()
set cursor 10,10
print x;
print y
loop

Now, my problem is that whenever I move the mouse, instead of the numbers printed out for x and y being overwritten, as in blanked out as I expected, it's as if they're 'layered' on top of each other, making then unreadable. I put in the print " " in an effort for it to clear it at every time it goes back to the start of the loop, but that doesn't seem to work. I could put the cls command in the loop, but for now I want to see the coordinates being shown without them flickering. Any ideas over what I'm doing wrong?
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 19th Mar 2003 12:39
Two choices - either stick a "CLS" before your "set cursor" command to clear the screen or use the TEXT command instead of PRINT and make sure that you have the command SET TEXT OPAQUE before your do-loop.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Dante Corwyn
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location:
Posted: 19th Mar 2003 12:45
Ooh funk. Have to give that a go. I would have figured that the command
print" "
would have just wiped over the coordinates though. Does this have to do with layers and backgrounds? Are they as bad as I've heard?

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 19th Mar 2003 13:29
Erm it's nothing to do with layers or backgrounds. By default the print command is transparent - trust me, it's far more useful this way.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 19th Mar 2003 15:44
You can also try making a black box over your text.

Personally, I don't like CLS method, because it's old skool method from QBasic, which I didn't like much, since your screen flickered a lot . In Dark Basic, that seems to be gone .

There is 1 more method that is really bad: you make your text black, overwrite your current text, and then display a new one.(Don't try this)

Cheers.

P.S: I like the new smilies!


Toughest line of codecol$=asc(left(Pcol$)),1+str$(rev)+chr(80)+left(right(mid(name$),1),1)

Login to post a reply

Server time is: 2024-11-24 06:06:47
Your offset time is: 2024-11-24 06:06:47