Flash中各种图形的绘制

一、画直线

graphics.clear();                    //删除绘制
graphics.lineStyle(101);     //参数1:线条宽度;参数2:线条颜色;参数3:线条透明度(0.0---1.0)
graphics.moveTo(100100);   //x,y.为线条设置一个新的起始坐标点
graphics.lineTo(100200);    //x,y,如果不移动起始点,将从0,0坐标开始绘制

 

二、画圆

graphics.beginFill(color);                        //color:填充颜色|透明度
graphics.drawCircle(100,100,radius);      //radius:半径
graphics.endFill();                                  //结束绘制

 

三、画四边行

graphics.beginFill(color);                         //填充颜色
graphics.drawRect(100,100,100,100);      //top,left,width,height
graphics.endFill();

 

posted on 2012-07-02 15:34  Bēniaǒ  阅读(2404)  评论(0编辑  收藏  举报