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 / simple program that prints on the screen current x and y position of mouse

Author
Message
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 7th Jul 2003 07:19
Hi, I am having trouble figuring out the code to tracking current x,y position of the mouse. Can anyone help ?

UnseenGhost
Neophyte
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 7th Jul 2003 07:41
MouseX() and MouseY(). Those commands should return their respective X and Y coordinates for the mouse. They should be in the help section under Commands->Input Commands.

Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 7th Jul 2003 07:49
I did look there, I couldn't understand it with all that jiberish that is mixed in the code with it. I wish they would have put simple examples for the code without all the extra jiberish junk I don't even understand yet

UnseenGhost

Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 7th Jul 2003 07:59
This is as simple as I know. Very little jiberish

Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 7th Jul 2003 08:49
I went to the - Input Command Menu where you said. I didn't see a lot that I understood, but I have an idea. I will let you know if it works.

UnseenGhost

AzureZeal
23
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 7th Jul 2003 09:30
Just type this...

print "mouse x = ";mousex()
print "mouse y = ";mousey()

If you wanted to record those positions into variables use this...

x = mousex()
y = mousey()

Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 7th Jul 2003 18:45
Unseen, I am something of a newbie, but try this:



Try that.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 7th Jul 2003 21:38
One of the first things I ever made in DBP ages ago, not very clean, and very lengthy, but take a look as it utilises other useful commands to.



I hear and I forget. I see and I remember. I do and I understand.
Ishamael Sedai
23
Years of Service
User Offline
Joined: 1st Jul 2003
Location: France
Posted: 7th Jul 2003 21:52
here somethin that I can prog..I am the eternaL NEWbie yousee
Quote: "
Function Enable pointer Coord
show mouse
repeat
set cursor 80,200: print "X:", mousex()
set cursor 80,220: print "Y:", mousey()
until spacekey()=1
endfunction"


I am the Betrayer of hope naebl'is by the will of
the Great Lord of the Dark. If you do not want to surrender, your soul will burn in the deepest hole of the Pit of doom.
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 13th Jul 2003 07:18
Thanks for all the help everyone

UnseenGhost

Login to post a reply

Server time is: 2026-07-21 12:49:28
Your offset time is: 2026-07-21 12:49:28