Saturday 1 February 2014

drag and drop

a = Shapes.AddEllipse(100,100)
b = Shapes.AddRectangle(100,100)
GraphicsWindow.MouseMove = mousemove

Sub mousemove
  If GraphicsWindow.MouseX >= Shapes.GetLeft(b) then
    If GraphicsWindow.MouseX <= Shapes.GetLeft(b) + 100 then
      If GraphicsWindow.MouseY >= Shapes.GetTop(b) Then
        If GraphicsWindow.MouseY <= Shapes.GetTop(b) + 100 then
  While Mouse.IsLeftButtonDown
    Shapes.move(b, GraphicsWindow.MouseX - 50, GraphicsWindow.MouseY - 50)
  Endwhile
EndIf
EndIf
EndIf
endif
endsub

No comments:

Post a Comment