class openfl.display.GraphicsPath implements IGraphicsPath implements IGraphicsData
Available on all platforms
A collection of drawing commands and the coordinate parameters for those commands.
Use a GraphicsPath object with the
Graphics.drawGraphicsData()
method. Drawing a GraphicsPath
object is the equivalent of calling the Graphics.drawPath()
method.
The GraphicsPath class also has its own set of methods
(curveTo()
, lineTo()
, moveTo()
wideLineTo()
and wideMoveTo()
) similar to those
in the Graphics class for making adjustments to the
GraphicsPath.commands
and GraphicsPath.data
vector arrays.
Instance Fields
The Vector of drawing commands as integers representing the path. Each command can be one of the values defined by the GraphicsPathCommand class.
var winding:GraphicsPathWinding
Specifies the winding rule using a value defined in the GraphicsPathWinding class.
function new(?commands:Vector<Int> = null, ?data:Vector<Float> = null, ?winding:GraphicsPathWinding = null):Void
Creates a new GraphicsPath object.
winding | Specifies the winding rule using a value defined in the GraphicsPathWinding class. |
function curveTo(controlX:Float, controlY:Float, anchorX:Float, anchorY:Float):Void
Adds a new "curveTo" command to the commands
vector and new
coordinates to the data
vector.
controlX | A number that specifies the horizontal position of the control point relative to the registration point of the parent display object. |
controlY | A number that specifies the vertical position of the control point relative to the registration point of the parent display object. |
anchorX | A number that specifies the horizontal position of the next anchor point relative to the registration point of the parent display object. |
anchorY | A number that specifies the vertical position of the next anchor point relative to the registration point of the parent display object. |
function lineTo(x:Float, y:Float):Void
Adds a new "lineTo" command to the commands
vector and new
coordinates to the data
vector.
x | The x coordinate of the destination point for the line. |
y | The y coordinate of the destination point for the line. |
function moveTo(x:Float, y:Float):Void
Adds a new "moveTo" command to the commands
vector and new
coordinates to the data
vector.
x | The x coordinate of the destination point. |
y | The y coordinate of the destination point. |
function wideLineTo(x:Float, y:Float):Void
Adds a new "wideLineTo" command to the commands
vector and
new coordinates to the data
vector.
x | The x-coordinate of the destination point for the line. |
y | The y-coordinate of the destination point for the line. |
function wideMoveTo(x:Float, y:Float):Void
Adds a new "wideMoveTo" command to the commands
vector and
new coordinates to the data
vector.
x | The x-coordinate of the destination point. |
y | The y-coordinate of the destination point. |