Polygon

The polygon render extension draws a filled (convex) polygon to the screen. This extension is only available when the polygon plugin has been loaded. The Trend Sample demonstrates how to use a polygon with dynamic point generation to render a trend graph.

The polygon render extension uses many standard options but also includes:

Points

a list of points for the polygon (string). The list of points are x,y values that are space separated, for example: 10,20 5,5 0,0.

Style

The style of polygon to render (string). The style corresponds to one of the following values:

Dash ("dash")

Draw a dashed line using Fill (color) and Dash Pattern attributes

Fill ("fill")

Draw a filled polygon using Fill (color) attribute

Fill & Stroke ("filloutline")

Draw a filled polygon using Fill (color) attribute, then outlined with Outline (color) attribute

Line ("line")

Draw a line using Fill (color) attribute

Loop ("loop")

Draw a line (with connected ends) using Fill (color) attribute

Quad ("quad")

Draw quadratic bezier curves defined by every 3 points using Fill (color) attribute

Cubic ("cubic")

Draw cubic bezier curves defined by every 4 points using Fill (color) attribute

Spline ("spline")

Draw an automatically interpolated bezier curve between the points using Fill (color) attribute

Line Width ("linewidth")

Changes width of the outline (stroke) drawn (number)

Dash Pattern ("dash")

Defines the dash size and the space size between each dash, only used with "dash" style (string). For example a long line short space might look like "10 5 10 5"

Anti-alias ("antialias")

Indicates if the polygon line drawn should be anti-aliased (1) or not (0). Single width outlined polygons are not anti-aliased on OpenGL ES 2.0 platforms. The multisample option for the OpenGL ES 2.0 Storyboard runtime controls polygon anti-aliasing.

Fill ("color")

The color used to fill the polygon.

Outline ("outlinecolor")

The color used to outline (stroke) a filled polygon i.e. if the style is Fill & Stroke

Was this article helpful?
0 out of 0 found this helpful