Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

VectorPolygon Class

Extends the Vector class with support for generating polygons.

The VectorPolygon class provides support for three different types of vector:

  • Closed-point polygons consisting of at least 3 points.
  • Open polygons consisting of at least 3 points (a 'polyline' in SVG).
  • Single lines consisting of two points only (a 'line' in SVG).

To create a polyline, set the Closed field to false.

To create a line, set the Closed field to false and set only two points (X1,Y1) and (X2,Y2)

Structure

The VectorPolygon class consists of the following fields:

Access
NameTypeComment
  ClosedINTIf true, the polygon will be closed between the start and end points.

Set the Closed field to true to ensure that the polygon is closed between the start and end points. This behaviour is the default. If false, the polygon will not be closed, which results in the equivalent of the SVG polyline type.

  PathLengthINTCalibrates the user agent's distance-along-a-path calculations with that of the author.

The author's computation of the total length of the path, in user units. This value is used to calibrate the user agent's own distance-along-a-path calculations with that of the author. The user agent will scale all distance-along-a-path computations by the ratio of PathLength to the user agent's own computed value for total path length. This feature potentially affects calculations for text on a path, motion animation and various stroke operations.

  PointsSTRINGA series of (X,Y) coordinates that define the polygon.

The Points field can be set with a series of (X, Y) coordinates that will define the polygon's shape. A minimum of two numbered pairs will be required to define a valid polygon. Each point must be separated with either white-space or a comma.

  PointsArrayAPTR []A series of numbered pairs that define the polygon.

The PointsArray field can be set with a VectorPoint array that defines the shape of a polygon. A minimum of two points is required for the shape to be valid. The VectorPoint structure consists of the following fields:

FieldTypeDescription
XDOUBLEThe X coordinate of this point.
YDOUBLEThe Y coordinate of this point.
XScaledUBYTETRUE if the X value is scaled to its viewport (between 0 and 1.0).
YScaledUBYTETRUE if the Y value is scaled to its viewport (between 0 and 1.0).
  TotalPointsINTThe total number of coordinates defined in the Points field.

TotalPoints is a read-only field value that reflects the total number of coordinates that have been set in the Points array. The minimum value is 2.

  X1DOUBLEDefines the X coordinate of the first point.

This field defines the X coordinate of the first point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line.

By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage.

  X2DOUBLEDefines the X coordinate of the second point.

This field defines the X coordinate of the second point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line.

By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage.

  Y1DOUBLEDefines the Y coordinate of the first point.

This field defines the Y coordinate of the first point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line.

By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage.

  Y2DOUBLEDefines the Y coordinate of the second point.

This field defines the Y coordinate of the second point of the polygon. It is recommended that this field is only used when creating a VectorPolygon that will be used to draw a single line.

By default the value will be treated as a fixed coordinate. Scaled values are supported if the value is a defined as a percentage.

VectorPolygon class documentation © Paul Manias © 2010-2025

VectorPoint Structure

Structure for the VectorPolygon PointsArray field.

FieldTypeDescription
XDOUBLEThe X coordinate of this point.
YDOUBLEThe Y coordinate of this point.
XScaledUBYTETRUE if the X value is scaled to its viewport (between 0 and 1.0).
YScaledUBYTETRUE if the Y value is scaled to its viewport (between 0 and 1.0).
VectorPolygon class documentation © Paul Manias © 2010-2025