vertexList 1077
// JavaScript syntax
member("Archie").vertex[2].handle1 = point(-63.0000, -16.0000);
See also
vertexList
vertexList
Usage
-- Lingo syntax
memberObjRef
.vertexList
// JavaScript syntax
memberObjRef
.vertexList;
Description
Cast member property; returns a linear list containing property lists, one for each vertex of a
vector shape. The property list contains the location of the vertex and the control handle. There
are no control handles if the location is (0,0).
Each vertex can have two control handles that determine the curve between this vertex and the
adjacent vertices. In
vertexList
, the coordinates of the control handles for a vertex are kept
relative to that vertex, rather than absolute in the coordinate system of the shape. If the first
control handle of a vertex is located 10 pixels to the left of that vertex, its location is stored as
(-10, 0). Thus, when the location of a vertex is changed with Lingo, the control handles move
with the vertex and do not need to be updated (unless the user specifically wants to change the
location or size of the handle).
When modifying this property, be aware that you must reset the list contents after changing any
of the values. This is because when you set a variable to the value of the property, you are placing
a copy of the list, not the list itself, in the variable. To effect a change, use code like this:
- Get the current property contents
currVertList = member(1).vertexList
-- Add 25 pixels to the horizontal and vertical positions of the first vertex
in the list
currVertList[1] .vertex = currVertList[1] . point(25, 25)
-- Reset the actual property to the newly computed position
member(1).vertexList = currVertList
Example
This statement displays the
vertextList
value for an arched line with two vertices:
-- Lingo syntax
put(member("Archie").vertexList)
-- [[#vertex: point(-66.0000, 37.0000), \
#handle1: point(-70.0000, -36.0000), \
#handle2: point(-62.0000, 110.0000)], [#vertex: point(66.0000, -5.0000), \
#handle1: point(121.0000, 56.0000), #handle2: point(11.0000, -66.0000)]]
// JavaScript syntax
put(member("Archie").vertexList);
//[[#vertex: point(-66.0000, 37.0000), #handle1: point(-70.0000, -36.0000),
#handle2: point(-62.0000, 110.0000)], [#vertex: point(66.0000, -5.0000),
#handle1: point(121.0000, 56.0000), #handle2: point(11.0000, -66.0000)]]
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...