The mouse doesn't move very smoothly so if you move it fast the pointer leaves the title bar.
Run this code and move the mouse fast an you will see the jumps.
do
dot mousex(),mousey()
loop
To get around it you need to set a flag when the user clicks the mouse in the title bar. Then move the window while the flag is set. Then when the user releases the button unset the flag.
Example
`mouse cursor image
get image 1,0,0,1,1,1
`titlebar image
box 0,0,100,20
get image 5,0,0,100,20,1
cls
`mouse sprite
sprite 1,mousex(),mousey(),1
`titlebar sprite
sprite 5,50,50,5
`flag
move = 0
`mouse offset from topleft of sprite
offset_x = 0
offset_y = 0
do
if move = 0 and sprite hit(1,5) and mouseclick() = 1
move = 1
offset_x = mousex() - sprite x(5)
offset_y = mousey() - sprite y(5)
endif
if move = 1
sprite 5, mousex() - offset_x, mousey() - offset_y, 5
if mouseclick() = 0 then move = 0
endif
sprite 1,mousex(),mousey(),1
loop
can i scream