var canvas : int := GUI.CreateCanvas (112, 65, 640, 400)
Draw.Line (113, 66, 113, 400, 7)
Draw.Line (113, 66, 640, 66, 7)
Draw.Fill (113, 65, 1, 7)
var x, y, btnNumber, btnUpDown, buttons : int
var newx, newy : int
loop
Mouse.ButtonWait ("down", x, y, btnNumber, btnUpDown)
newx := x
newy := y
if newx > 112 and newx < maxx and newy > 75 and newy < maxy and x > 112
and y > 75 then
loop
Draw.Line (x, y, newx, newy, 0) % Erase previous line
exit when Mouse.ButtonMoved ("up")
Mouse.Where (newx, newy, buttons)
Draw.Line (x, y, newx, newy, 1) % Draw line to position
end loop
% I think this is where I should put Mouse.Where, put I'm new with most of these commands and I'm not sure how I would use it.
Mouse.ButtonWait ("up", newx, newy, btnNumber, btnUpDown)
Draw.Line (x, y, newx, newy, 2) % Draw line to final position
else
end if
end loop
|