Page 1 of 1

creating a line by script

Posted: Thu Nov 18, 2010 5:45 am
by sadan
hi
i checked all the codes as much as my knowledge "first draw a line by using tools box then move or change coordinates"
but i want to create a line from one point to another point by using codes
i am trying to warm up with this language and myself is familiar with asymetrix toolbook
thanks

Re: creating a line by script

Posted: Thu Nov 18, 2010 6:49 am
by Janschenkel
Try the script below in a button:

Code: Select all

on mouseUp
   reset the templateGraphic
   set the style of the templateGraphic to "line"
   set the points of the templateGraphic to "100,100" & return & "200,250"
   create graphic
end mouseUp
This gives you a graphic control that you can manipulate further by changing its properties.

HTH,

Jan Schenkel

Re: creating a line by script

Posted: Thu Nov 18, 2010 1:17 pm
by Klaus
Hi Sadan,

please take care to post in the correct section the next time!
Creating a line graphic in LiveCode by script is definitvely NOT off-topic 8)


Best

Klaus

P.S.
Unfortunately I am not able/allowed to move these posting to the right forum.