Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

draw line to point

Status
Not open for further replies.

3Y3

Programmer
Sep 18, 2001
45
CA
I've been trying this out myself but i cant seem to make it work right.

I wish to draw a line from point A to point B(which is the mouses current posistion) using lingo code. This line must remain snapped to the mouse so when the mouse moves the line remains as a path to the mouse.

any ideas..thanks in advance

3Y3
 
Make a vector shape with a 45 degree line (VERY IMPROTANT, wont work with any other line).

Then use this script (will use point 200,200 as the starting point)

on exitFrame me
if the mouseV > 200 and the mouseh < 200 then
-- flip it first
sprite(1).rotation = 90
else if the mousev <200 and the mouseh > 200 then
sprite(1).rotation = 90
else
sprite(1).rotation = 0
end if

sprite(1).rect = rect(200,200,the mouseh, the mousev)

go to the frame

end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top