1、线样式定义。
Package | graphics |
Class | public class LineStyle |
Inheritance | LineStyle --> Object |
Implements | ILineStyle |
Defines the line style of the vector shapes. See the flash.display.graphics.lineStyle method. ( 定义线矢量形状样式。)
alpha : Number
定义线颜色透明度。 取值范围[0,1], 0完全透明,1完全不透明。 设置值小于0则取值0,设置值大于1则取值1。
A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1 (solid). If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.
| LineStyle | ||
caps : String
定义线头线尾的覆盖样式。 取值范围:"none" :正常 ; "round" :以线宽为直径凸出半圆样;"square" :以线宽为宽凸出几个像素单位的方形。
A value from the CapsStyle class that specifies the type of caps at the end of lines. Valid values are : CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. If a value is not indicated, Flash uses round caps.
| LineStyle | ||
color : uint 线颜色定义。 A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 (black). | LineStyle | ||
joints : String 多线相连场景下连接点的覆盖样式。取值大小写敏感。"round":圆弧形状(默认), "miter":角度形状,"bevel":按水平或垂直线磨平角度。
A value from the JointStyle class that specifies the type of joint appearance used at angles. Valid values are: JointStyle.BEVEL, JointStyle.MITER, and JointStyle.ROUND. If a value is not indicated, Flash uses round joints.
| LineStyle | ||
miterLimit : Number 多线连接场景下基于连接点,角度可延伸出的最大极限像素因子(距离=thickness*miterLimit),如有多出部分做截断处理。仅当joints="miter"时有效。 A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels. | LineStyle | ||
pixelHinting : Boolean
是否清晰展示斜线的锯齿,true: 显示锯齿,false: 钝化锯齿。
A Boolean value that specifies whether to hint strokes to full pixels.This affects both the position of anchors of a curve and the line stroke size itself. \With pixelHinting set to true, Flash Player hints line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines.
| LineStyle | ||
scaleMode : String 定义线缩放设置项。
A value from the LineScaleMode class that specifies which scale mode to use :
| LineStyle | ||
thickness : Number
An integer that indicates the thickness of the line in points ; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, the default is 0. The value 0 indicates hairline thickness ; the maximum thickness is 255. If a value greater than 255 is passed, the default is 255. 定义线宽。 有效取值范围:[0,255],设置值小于0则取值0,设置值大于255则取值255。设置0值等价于取值最小线宽(一般为1)。 |
应用示例--线宽为8,红色,半透明,不显示锯齿,不缩放,多线连接点为角度形状,角度最大延伸像素因子2(最大延伸像素值=8*2=16):
graphics.lineStyle(8,0xFF0000,0.5,false,"none","none","miter",2));
graphics.moveTo(point1.X, point1.Y);
graphics.lineTo(point2.X, point2.Y);
graphics.lineTo(point3.X, point3.Y);