| 包 | flash.display |
| 类 | public final class GraphicsPath |
| 继承 | GraphicsPath Object |
| 实现 | IGraphicsPath, IGraphicsData |
| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将 GraphicsPath 对象与 Graphics.drawGraphicsData() 方法一起使用。绘制 GraphicsPath 对象与调用 Graphics.drawPath() 方法是等效的。
GraphicsPath 还具有一组自己的方法(curveTo()、lineTo()、moveTo()、wideLineTo() 和 wideMoveTo()),这些方法与 Graphics 类中用于调整 GraphicsPath.commands 和 GraphicsPath.data 矢量数组的方法类似。
另请参见
| 属性 | 定义方 | ||
|---|---|---|---|
| commands : Vector.<int> 由绘画命令构成的矢量,其中的整数表示路径。 | GraphicsPath | ||
![]() | constructor : Object
对类对象或给定对象实例的构造函数的引用。 | Object | |
| data : Vector.<Number> 由数字构成的矢量,其中包含与绘图命令一起使用的参数。 | GraphicsPath | ||
![]() | prototype : Object [静态]
对类或函数对象的原型对象的引用。 | Object | |
| winding : String 使用 GraphicsPathWinding 类中定义的值指定缠绕规则。 | GraphicsPath | ||
| 方法 | 定义方 | ||
|---|---|---|---|
创建新的 GraphicsPath 对象。 | GraphicsPath | ||
将新的“curveTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。 | GraphicsPath | ||
![]() |
指示对象是否已经定义了指定的属性。 | Object | |
![]() |
指示 Object 类的实例是否在指定为参数的对象的原型链中。 | Object | |
将新的“lineTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。 | GraphicsPath | ||
将新的“moveTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。 | GraphicsPath | ||
![]() |
指示指定的属性是否存在、是否可枚举。 | Object | |
![]() |
设置循环操作动态属性的可用性。 | Object | |
![]() |
返回指定对象的字符串表示形式。 | Object | |
![]() |
返回指定对象的原始值。 | Object | |
将新的“wideLineTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。 | GraphicsPath | ||
将新的“wideMoveTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。 | GraphicsPath | ||
| commands | 属性 |
public var commands:Vector.<int>| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
由绘画命令构成的矢量,其中的整数表示路径。每个命令都可以是 GraphicsPathCommand 类定义的值之一。
另请参见
| data | 属性 |
public var data:Vector.<Number>| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
由数字构成的矢量,其中包含与绘图命令一起使用的参数。
| winding | 属性 |
winding:String [读写] | 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
使用 GraphicsPathWinding 类中定义的值指定缠绕规则。
public function get winding():String public function set winding(value:String):void另请参见
| GraphicsPath | () | 构造函数 |
public function GraphicsPath(commands:Vector.<int> = null, data:Vector.<Number> = null, winding:String = "evenOdd")| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
创建新的 GraphicsPath 对象。
参数commands:Vector.<int> (default = null) — 一个由整数构成的矢量,表示由 GraphicsPathCommand 类定义的命令。 | |
data:Vector.<Number> (default = null) — 一个由数字构成的矢量,其中的每一对数字将被视为一个点(一个 x, y 对)。 | |
winding:String (default = "evenOdd") — 使用 GraphicsPathWinding 类中定义的值指定缠绕规则。 |
另请参见
| curveTo | () | 方法 |
public function curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将新的“curveTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。
参数
controlX:Number — 一个数字,指定控制点相对于父显示对象注册点的水平位置。 | |
controlY:Number — 一个数字,指定控制点相对于父显示对象注册点的垂直位置。 | |
anchorX:Number — 一个数字,指定下一个锚点相对于父显示对象注册点的水平位置。 | |
anchorY:Number — 一个数字,指定下一个锚点相对于父显示对象注册点的垂直位置。 |
另请参见
| lineTo | () | 方法 |
public function lineTo(x:Number, y:Number):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将新的“lineTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。
参数
x:Number — 直线目标点的 x 坐标。 | |
y:Number — 直线目标点的 y 坐标。 |
另请参见
| moveTo | () | 方法 |
public function moveTo(x:Number, y:Number):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将新的“moveTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。
参数
x:Number — 目标点的 x 坐标。 | |
y:Number — 目标点的 y 坐标。 |
另请参见
| wideLineTo | () | 方法 |
public function wideLineTo(x:Number, y:Number):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将新的“wideLineTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。
参数
x:Number — 直线目标点的 x 坐标。 | |
y:Number — 直线目标点的 y 坐标。 |
另请参见
| wideMoveTo | () | 方法 |
public function wideMoveTo(x:Number, y:Number):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将新的“wideMoveTo”命令添加到 commands 矢量,并将新坐标添加到 data 矢量。
参数
x:Number — 目标点的 x 坐标。 | |
y:Number — 目标点的 y 坐标。 |
另请参见