Mousex()/mousey() init at 0,0

BlitzMax Forums/BlitzMax Beginners Area/Mousex()/mousey() init at 0,0

tonyg(Posted 2007) [#1]
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.


Czar Flavius(Posted 2007) [#2]
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...


WendellM(Posted 2007) [#3]
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.


tonyg(Posted 2007) [#4]
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.


Grey Alien(Posted 2007) [#5]
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.