2016-10-25 3 views
0

私はActionscript 2でカスタムシェイプを作成するのに助けが必要です。丸い四角形を作成したいだけです。コードだけを使用したいと思います。コーディング..それが可能な場合私はActionscript 3の可能性を知っている..しかし、私は多くのactionscript 2を取得しませんでした..私の質問は..どのように私はカスタムコーナーを使用してActionscript 2の丸い四角形を作るが、 ?私は、カスタムカーブを必要とする理由は、私はエッジを丸めている、完全に正方形の長方形と下部のトップを作ることができるようにしたいされ、アドバンスActionscript 2:カスタムシェイプを作成する

答えて

0

のおかげで、いくつかのおかげでちょうど

を変更しなければならなかった研究..それを考え出しましたコードの
function drawRoundedRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number):Void { 
with (target_mc) { 
beginFill(fillColor, fillAlpha); 
moveTo(cornerRadius, 0); 
lineTo(boxWidth - cornerRadius, 0); 
curveTo(boxWidth, 0, boxWidth, cornerRadius); 
lineTo(boxWidth, cornerRadius); 
lineTo(boxWidth, boxHeight - cornerRadius); 
curveTo(boxWidth, boxHeight, boxWidth - cornerRadius, boxHeight); 
lineTo(boxWidth - cornerRadius, boxHeight); 
lineTo(cornerRadius, boxHeight); 
curveTo(0, boxHeight, 0, boxHeight - cornerRadius); 
lineTo(0, boxHeight - cornerRadius); 
lineTo(0, cornerRadius); 
curveTo(0, 0, cornerRadius, 0); 
lineTo(cornerRadius, 0); 
endFill(); 

出典:How can i draw a round rectangle as2

私が行った変更は、ここに

beginFill(fillColor, fillAlpha); 
moveTo(cornerRadius, 0); 
lineTo(boxWidth, 0); 
curveTo(boxWidth, 0, boxWidth, cornerRadius); 
lineTo(boxWidth, cornerRadius); 
lineTo(boxWidth, boxHeight - cornerRadius); curveTo(boxWidth, boxHeight, boxWidth - cornerRadius, boxHeight); 
lineTo(boxWidth - cornerRadius, boxHeight); 
lineTo(cornerRadius, boxHeight); 
curveTo(0, boxHeight, 0, boxHeight - cornerRadius); 
lineTo(0, boxHeight - cornerRadius); 
lineTo(0, cornerRadius); lineTo(0, 0); 
endFill(); 
です
関連する問題