Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function BuildSurface():void
- {
- //Reset image
- shape.graphics.clear();
- //Line style
- if(lineWeight)
- shape.graphics.lineStyle(lineWeight,lineColor);
- else
- shape.graphics.lineStyle();
- //Begin fill
- switch(fillType)
- {
- case TFILL_FLAT:
- shape.graphics.beginFill(fillColor);
- break;
- case TFILL_GRAD:
- var gradient:Matrix = new Matrix();
- gradient.createGradientBox(width,height,gradDir*Math.PI/2.0);
- shape.graphics.beginGradientFill(GradientType.LINEAR,[fillColor,fillColor2],[1,1],[0,255],gradient);
- break;
- case TFILL_PATTERN:
- shape.graphics.beginBitmapFill(ho.getImage(patterns[0]).img);
- break;
- case TFILL_IMAGE:
- var image:CImage = ho.getImage(images[0]);
- var mat:Matrix = new Matrix();
- mat.scale(width/image.width,height/image.height);
- shape.graphics.beginBitmapFill(image.img,mat,false,(imageOptions&IMGOPT_RESAMPLE)>0);
- break;
- }
- //Shape
- switch(shapeType)
- {
- case TSHAPE_RECT:
- shape.graphics.drawRect(0,0,width,height);
- break;
- case TSHAPE_ELLIPSE:
- shape.graphics.drawEllipse(0,0,width,height);
- break;
- case TSHAPE_POLY:
- break;
- }
- //End fill
- shape.graphics.endFill();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement