Draw a line that follows an object

dunbarx at aol.com dunbarx at aol.com
Fri Jun 28 16:16:55 EDT 2019


Hi.
So much fun. Change the handler to this:
local pointsListon mouseDown  show btn 1 at "200,200"  set the points of grc 1 to "0,0" & comma & the loc of btn 1  put the points of grc 1 &return into pointsList  trackButtonend mouseDown
on trackButton  if the optionKey is down then exit to top -- exit here  set the loc of btn 1 to the mouseLoc  put the loc of btn 1 & return after pointsList  set the points of grc 1 to pointsList  send "trackButton" to me in 1end trackButton
Not sure how you want to stop drawing. Let me know how you decide that.
Craig

-----Original Message-----
From: General 2018 via use-livecode <use-livecode at lists.runrev.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Cc: General 2018 <General.2018 at outlook.com>
Sent: Fri, Jun 28, 2019 2:21 pm
Subject: RE: Draw a line that follows an object

Hi ,

Thanks , so nearly - I have a line that follows the object from the top left corner.

What I need is just like drawing with a pen , the object being the tip. Where the object moves a line is drawn and remains like ink.


Regards
Camm

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of dunbarxx via use-livecode
Sent: 26 June 2019 16:51
To: use-revolution at lists.runrev.com
Cc: dunbarxx
Subject: Re: Draw a line that follows an object

Hi.

Not sure what you really want, but maybe try this. On a new card create a
button and a line graphic. Put this into the button script:

on mouseDown
  trackButton
end mouseDown

on trackButton
  if the optionKey is down then exit to top -- exit here
  set the loc of btn 1 to the mouseLoc
  set the points of grc 1 to "10,10" & return & item 1 of the loc of btn 1
& "," & item 2 of the loc of btn 1
  send "trackButton" to me in 1
end trackButton

Craig



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list