Lingo Dictionary > A-C > curve

 

curve

Syntax

member.curve[curveListIndex]

Description

This property contains the vertexList of an individual curve (shape) from a vector shape cast member. You can use the curve property along with the vertex property to get individual vertices of a specific curve in a vector shape.

A vertexList is a list of vertices, and each vertex is a property list containing up to three properties: a #vertex property with the location of the vertex, a #handle1 property with the location of the first control point for that vertex, and a #handle2 property with the location of the second control point for that vertex. See vertexList.

Example

This statement displays the list of vertices of the third curve of vector shape member SimpleCurves:

put member("SimpleCurves").curve[3]
-- [[#vertex: point(113.0000, 40.0000), #handle1: point(32.0000, 10.0000), #handle2: point(-32.0000, -10.0000)], [#vertex: point(164.0000, 56.0000)]]

Example

This statement moves the first vertex of the first curve in a vector shape down and to the right by 10 pixels:

member(1).curve[1].vertex[1] = member(1).curve[1].vertex[1] + point(10, 10)

Example

The code below moves a sprite to the location of the first vertex of the first curve in a vector shape. The vector shape's originMode must be set to #topLeft for this to work.

vertexLoc = member(1).curve[1].vertex[1]
spriteLoc = mapMemberToStage(sprite(3), vertexLoc)
sprite(7).loc = spriteLoc
vertex, vertexList