creating a line by script

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sadan
Posts: 2
Joined: Thu Nov 18, 2010 5:31 am

creating a line by script

Post by sadan » Thu Nov 18, 2010 5:45 am

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

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: creating a line by script

Post by Janschenkel » Thu Nov 18, 2010 6:49 am

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
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: creating a line by script

Post by Klaus » Thu Nov 18, 2010 1:17 pm

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.

Post Reply