[quoted text, click to view] > can somebody help me with the draw api?
>
> I know how to make an square, or an ovel, but I need one square whit round
> corners, and this I can't make...
first paste to timeline frame
_global.drawBorder = function
(movieClip,colour,padding,weight,radius,width,height,alpha,fill,fillColor,offset)
{
padding = parseInt(padding);
radius = parseInt(radius);
width = parseInt(width);
height = parseInt(height);
xAxis1 = -padding + offset;
xAxis2 = -padding+radius + offset;
xAxis3 = width+padding-radius + offset;
xAxis4 = width+padding + offset;
yAxis1 = -padding + offset;
yAxis2 = -padding+radius + offset;
yAxis3 = height+padding-radius + offset;
yAxis4 = height+padding + offset;
if(fill == 1){
movieClip.beginFill(fillColor,alpha);
}
movieClip.lineStyle(weight,colour,alpha);
movieClip.moveTo(xAxis2,yAxis1);
movieClip.lineTo(xAxis3,yAxis1);
movieClip.curveTo(xAxis4,yAxis1,xAxis4,yAxis2);
movieClip.lineTo(xAxis4,yAxis3);
movieClip.curveTo(xAxis4,yAxis4,xAxis3,yAxis4);
movieClip.lineTo(xAxis2,yAxis4);
movieClip.curveTo(xAxis1,yAxis4,xAxis1,yAxis3);
movieClip.lineTo(xAxis1,yAxis3);
movieClip.lineTo(xAxis1,yAxis2);
movieClip.curveTo(xAxis1,yAxis1,xAxis2,yAxis1);
movieClip.lineTo(xAxis2,yAxis1);
if(fill == 1){
movieClip.endFill();
}
};
Now , if you want to draw anytihng , simply :
//box 1
_root.createEmptyMovieClip("box1", 0);
box1._x = 20;
box1._y = 20;
drawBorder(box1,0x333333,0,1,6,200,200,100,true,0x99FF99, 0);
or another box :
//box 2
_root.createEmptyMovieClip("box2", 1);
box2._x = 20;
box2._y = 115;
drawBorder(box2,0x333333,0,1,6,250,75,100,true,0x999999, 0.5);
Play around with paramters, define color , size and location at will...
--
Regards
urami_*
<hol>
http://flashfugitive.com/ </hol>
By The way:
If you try to mail me , DO NOT *laugh*