Mouses...why this no work?

Blitz3D Forums/Blitz3D Beginners Area/Mouses...why this no work?

Gauge(Posted 2003) [#1]
Okay why doesn't this work? I'm trying to print the mouxe x/y/z out...but it won't do it...

AppTitle "Test Mouse"
Graphics 800,600,16,2
ShowPointer

While Not KeyHit(1)
WaitMouse()
a$=MouseY
b$=MouseX
c$=MouseZ
Print "mouse x/y/z"+a$+b$+c$
Print MouseX+MouseY+MouseZ

Wend
End




GNS(Posted 2003) [#2]
Don't forget the parenthesis (ie. MouseX(), MouseY(), and MouseZ()).


Sir Gak(Posted 2003) [#3]
The docs say:

ShowPointer is for use in windowed display modes, and simply shows the Windows pointer after it's been hidden (via HidePointer). It has no effect in full-screen modes.

If you are in full-screen mode, you have to do your own pointer. Get/draw for yourself a cursor image (typically an arrow). Use the command setbuffer backbuffer() abd draw the cursor to the screen, then flip.
example:
....
setbuffer backbuffer()
...
cursor = loadimage(mycursor.bmp)
...
;draw whatever graphics, text, etc, first, then the cursor
drawimage cursor,mousex(),mousey()
flip


NTense(Posted 2003) [#4]
Try this:

AppTitle "Test Mouse" 
Graphics 800,600,16,2 
ShowPointer 

While Not KeyHit(1) 
WaitMouse() 
a$=MouseY() 
b$=MouseX() 
c$=MouseZ() 
Print "mouse x/y/z = "+a$+","+b$+","+c$ 
Print MouseX()+","+MouseY()+","+MouseZ() 

Wend 
End 


It should work for you now... BTW, you could do real time with this:

AppTitle "Test Mouse" 
Graphics 800,600,16,2 
ShowPointer 

While Not KeyHit(1) 
Cls
a$=MouseY() 
b$=MouseX() 
c$=MouseZ() 
Locate 10,10
Print "mouse x/y/z = "+a$+","+b$+","+c$
Wend 
End 



Sir Gak(Posted 2003) [#5]
Umm, as I was re-reading your question, I saw that I perhaps overlooked something essential. If you are working in x/y/z coordinates, then you are working in 3d, right? If so, change your starting line:

Graphics 800,600,16,2

to use the 3d Graphics command:

Graphics3d 800,600, etc


Anthony Flack(Posted 2003) [#6]
Erm, isn't mousez the mousewheel though? AFAIK no mouse registers how high you lift it off the table ;o)


jhocking(Posted 2003) [#7]
Actually there is such a thing as a 3D mouse which senses vertical movement. They're pretty cool to use although few applications support the added degree of motion. But you are correct, MouseZ refers to the mousewheel.


Anthony Flack(Posted 2003) [#8]
Wow, really?
Wouldn't your arm get tired?


Sir Gak(Posted 2003) [#9]
Oh, well, ask a silly question...


jhocking(Posted 2003) [#10]
"Wouldn't your arm get tired?"
Yeah, but it's not as bad as you'ld think. You aren't meant to hold your arm out in midair. Generally you'ld use a 3D mouse with your elbow braced against something (eg. resting on the armrest.)


Sir Gak(Posted 2003) [#11]
Say, did gauge's original question ever get answered in a satisfactory way?


jhocking(Posted 2003) [#12]
I think so. It looked to me like he was just forgetting the parentheses, as in MouseX() not just MouseX.