Greetings,
I had a window that I made as a bitmap, and I and I want to be able to drag that bitmap around on the screen. I made a GOSUB command
Create3d_Object:
`Define the dimensions of the image
create3dwidth = 300
create3dheight = 13
` Allow the user to move the window around
`(create3dwindowx and create3dwindowy are global variables to track window position)
if mouseclick() = 1
if mousex() > create3dwindowx and mousex() < create3dwindowx+create3dwidth
if mousey() > create3dwindowy and mousey() < create3dwindowy+create3dheight
`Detect the target mouse position that we want to move the window to
create3dwindowxtarget = mousex()
create3dwindowytarget = mousey()
`Determine the direction and move the window accordingly
if create3dwindowx < create3dwindowxtarget then create3dwindowx = create3dwindowx + 5
if create3dwindowx > create3dwindowxtarget then create3dwindowx = create3dwindowx - 5
if create3dwindowy < create3dwindowytarget then create3dwindowy = create3dwindowy + 5
if create3dwindowy > create3dwindowytarget then create3dwindowy = create3dwindowy - 5
endif
endif
endif
`Draw the image to the screen
paste image 1,create3dwindowx,create3dwindowy
return
but this makes the bitmap drag around funny, it just juts around the screen and doesn't work right. Any suggestions for fixing this code?