Mousex()/mousey() init at 0,0
BlitzMax Forums/BlitzMax Beginners Area/Mousex()/mousey() init at 0,0
| ||
I can't remember seeing this before but running the following flashes the image at 0,0 as the mousex()/mousey() values don't seem to have been valued. Is this normal? Graphics 800 , 600 Local image:timage = LoadImage("Max.png") Print MouseX() + " " + MouseY() While Not KeyHit(KEY_ESCAPE) Cls DrawImage image,MouseX(),MouseY() Flip 0 Wend Not sure if this comes under the same banner as That thread is about someone who insists on using a Max2D window and not a MaxGUI window, utter foolishness... made by Skidracer here as it doesn't seem to occur in fullscreen. |
| ||
Not sure about your problem, but reading your title I thought this was going to be about a divide by zero problem when the mouse is in the corner of the screen. Just to clarify to others it is not... |
| ||
If this is something that hasn't been happening until lately, I wonder if it's related to the re-emergence of the mouse lag issue: http://blitzbasic.com/Community/posts.php?topic=69026 If you'd prefer the image to start at 0,0 and then jump to the actual mouse coords, you might consider using MoveMouse right after Graphics to specify where the mouse and image should start. |
| ||
I see the 'problem' in both windowed and fullscreen mode but the MoveMouse gets around it. No big deal just can't remember seeing it before. |
| ||
I couldn't quite understand you post at first. But you mean that when you run in windowed mode the mouse pointer stays at 0,0 until you move it. Yeah so mouseX and Y are 0. In full-screen it's in the middle on my PC. ACtually I don't use BMAx MouseX/Y in windowed mode because I want the cursor to slide out the window so I make API calls in my framework to get the coords relative to the desktop. One of my little tricks. |