Im in a hurry, so don’t give me the “please search before post”-talk. I need to draw a box with rounded corners. I can’t get a hang of it. I want to draw it from the following variables:
boxwidth = 200;
boxheight = 200;
radius = 5;
How do I draw this? You should see the artwork I have (by mistake) created while trying to get it right
’
system
July 16, 2004, 9:48am
2
you cant script it. What you can do on the other hand is draw this figure using the drawing tools of flash…(lineTo and fill)
system
July 16, 2004, 9:58am
3
I think you are [color=Red]wrong[/color]. I am almost ready with a function which does exactly this. I hope …
’
system
July 16, 2004, 5:36pm
5
So, show us your handywork!
system
July 18, 2004, 8:12pm
6
////////////////////////////////////////////////////////////////////////////////////////////////////
// Draw rectangle (p) ////////////////////////////////////////////////////////////////////////////
// www.votem.net /////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
MovieClip.prototype.draw_rect = function(x,y,w,h,r,lw,lc,la,fc,fa) {
with(this){
beginFill(fc,fa);
lineStyle(lw,lc,la);
moveTo(x+r,y);
lineTo(x+w-r,y);
curveTo(x+w,y,x+w,y+r);
lineTo(x+w,y+h-r);
curveTo(x+w,y+h,x+w-r,y+h);
lineTo(x+r,y+h);
curveTo(x,y+h,x,y+h-r);
lineTo(x,x+r);
curveTo(x,y,x+r,y);
endFill();
}
}
system
July 18, 2004, 9:43pm
7
I think you are wrong. I am almost ready with a function which does exactly this. I hope …
I think you didn’t understand my answer. What you did is exactly what I said should be done - didn’t you use the lineTo function ???
It’s been done before. What I meant is that there is no such function as drawRoundedRectangle(var,var,var,var,etc…)