; MouseX Example ; -------------- Graphics 640,480,0,2 SetBuffer BackBuffer() ; Hide the Windows pointer - the example draws its own crosshair HidePointer While Not KeyDown(1) Cls ; MouseX returns the pointer's x position on screen, ; from 0 to GraphicsWidth()-1 mx=MouseX() my=MouseY() ; Vertical range-marker tracks the MouseX position Color 90,90,90 Line mx,0,mx,479 ; Shooting-range crosshair at the full mouse position Color 255,255,0 Oval mx-10,my-10,20,20,False Line mx-14,my,mx+14,my Line mx,my-14,mx,my+14 Color 255,255,255 Text 0,0,"Move the mouse left and right Esc: exit" Text 0,20,"MouseX() = "+mx+" (0 to "+(GraphicsWidth()-1)+")" Flip Wend End