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: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Randall Lee Reetz
Posts: 28
Joined: Fri Sep 07, 2007 2:04 am
Location: Palo Alto, California, USA
Contact:

setting polygon points

Post by Randall Lee Reetz » Sun Dec 21, 2014 10:58 pm

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: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: setting polygon points

Post by Klaus » Sun Dec 21, 2014 11:10 pm

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
Location: Palo Alto, California, USA
Contact:

Re: setting polygon points

Post by Randall Lee Reetz » Mon Dec 22, 2014 1:37 am

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: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: setting polygon points

Post by Klaus » Mon Dec 22, 2014 1:40 am

You're welcome! 8)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: setting polygon points

Post by jacque » Mon Dec 22, 2014 5:29 pm

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

Return to “Multimedia”