setting polygon points

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Randall Lee Reetz
Posts: 28
Joined: Fri Sep 07, 2007 2:04 am
Contact:

setting polygon points

Post by Randall Lee Reetz »

I've put the following code into a button's script:

on mouseUp
put "100,100,200,200,100,500" into myPoints
set the points of graphic "myPoly" to myPoints
end mouseUp

There is of course a polygon on the same card named "myPoints"

But when I click on the button, nothing happens.

What is up???
What matters is what matters; knowing what matters and how to know it, matters the most.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: setting polygon points

Post by Klaus »

Hi Randall,

try this:
...
put "100,100" & CR & "200,200" & CR & "100,500" into myPoints
...
If in doubt, ALWAYS consult the dictionary first! 8)


Best

Klaus
Randall Lee Reetz
Posts: 28
Joined: Fri Sep 07, 2007 2:04 am
Contact:

Re: setting polygon points

Post by Randall Lee Reetz »

I tried that. But without the space characters between. Didn't work. The dictionary says that you can "set" points from comma delineated lists... but "put" points always returns lines of x,y pairs.
What matters is what matters; knowing what matters and how to know it, matters the most.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: setting polygon points

Post by Klaus »

You're welcome! 8)
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: setting polygon points

Post by jacque »

Commas used to work but somewhere along the line I read they stopped working. At any rate, I assume that "myPoints" is a typo and the name of the graphic is really "myPoly", right?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Post Reply