|
Graphics类继承于object闪奕flash培训-as培训-as暑期培训-flash as周末班-flash培训
每个 Shape、Sprite 和 MovieClip 对象都具有一个 graphics 属性,它是 Graphics 类的一
个实例。Graphics 类包含用于绘制线条、填充和形状的属性和方法闪奕flash培训-as培训-as暑期培训-flash as周末班-flash培训
绘制步骤:闪奕flash培训-as培训-as暑期培训-flash as周末班-flash培训
■ 定义线条:lineStyle(thickness:Number, color:uint = 0, alpha:Number = 1.0)
lineGradientStyle()渐变线条(在绘制渐变线条之前,必须先调用lineStyle启用笔触。)
放射状渐变闪奕flash培训-as培训-as暑期培训-flash as周末班-flash培训
import flash.display.Shape;
import flash.display.GradientType;
import flash.geom.Matrix;
var type:String = GradientType.RADIAL;
var colors:Array = [0x00FF00, 0x000088];
var alphas:Array = [1, 1];
var ratios:Array = [0, 255];
var spreadMethod:String = SpreadMethod.PAD;
var interp:String = InterpolationMethod.LINEAR_RGB;
var focalPtRatio:Number = 0;
var matrix:Matrix = new Matrix();
var boxWidth:Number = 50;
var boxHeight:Number = 100;
var boxRotation:Number = Math.PI/2; // 90°
var tx:Number = 25;
var ty:Number = 0;
matrix.createGradientBox(boxWidth, boxHeight, boxRotation, tx, ty);
width = 100;
height = 50;
rotation = Math.PI/2; // 90°
tx = 0;
ty = 0;
width = 100;
height = 50;
rotation = Math.PI/2; // 90°
tx = 0;
ty = 50;
width = 50;
height = 100;
rotation = 0;
tx = 25;
ty = 0;闪奕flash培训-as培训-as暑期培训-flash as周末班-flash培训
或许您还想了解:
as处理位图-闪奕 flash培训 as培训 flex培训 php培训
as处理文本-闪奕 flash培训 as培训 flex培训 php培训
as处理影片剪辑-闪奕 flash培训 as培训 flex培训 php培训
as滤镜和对象变形-闪奕 flash培训 as培训 flex培训 php培训
as过滤显示对象-闪奕 flash培训 as培训 flex培训 php培训
as使用内置方法绘制形状-闪奕 flash培训 as培训 flex培训 php培训
as创建渐变线条和填充-闪奕 flash培训 as培训 flex培训 php培训
as Graphics类继承于object-闪奕 flash培训 as培训 flex培训 php培训
闪奕flash培训-as培训-as暑期培训-flash as周末班-flash培训
|