Mouses...why this no work?
Blitz3D Forums/Blitz3D Beginners Area/Mouses...why this no work?
| ||
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 |
| ||
Don't forget the parenthesis (ie. MouseX(), MouseY(), and MouseZ()). |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
Erm, isn't mousez the mousewheel though? AFAIK no mouse registers how high you lift it off the table ;o) |
| ||
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. |
| ||
Wow, really? Wouldn't your arm get tired? |
| ||
Oh, well, ask a silly question... |
| ||
"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.) |
| ||
Say, did gauge's original question ever get answered in a satisfactory way? |
| ||
I think so. It looked to me like he was just forgetting the parentheses, as in MouseX() not just MouseX. |