on (release) { // 定義用戶(hù)輸入變量. var Width = Number(_root.ButW); var Height = Number(_root.ButH); var Left = Number(_root.ButL); var Top = Number(_root.ButT); var Round = Number(_root.ButR/100); var BColor = (_root.ButC); var Right = Left+Width; var Bottom = Top+Height; //第二個(gè)矩形的參數(shù) var SWidth = Width*0.9; var SHeight = Height*0.5; var SLeft = Left+(Width/20); var STop = Top+(Height/20); var SRound = Round*1.6; var SRight = SLeft+SWidth; var SBottom = STop+SHeight; //繪制矩形 FWJavascript("fw.getDocumentDOM().addNewRectanglePrimitive({left:"+left+", top:"+top+", right:"+right+", bottom:"+bottom+"},"+Round+"); "); //填充漸變色 FWJavascript("fw.getDocumentDOM().setFill({ category:'fc_Linear', ditherColors:[ '#000000', '#000000' ], edgeType:'antialiased', feather:0, gradient:{ name:'cn_Custom', nodes:[ { color:'#ffffff', isOpacityNode:false, position:0 }, { color:'"+BColor+"', isOpacityNode:false, position:1 } ], opacityNodes:[ { color:'#000000', isOpacityNode:true, position:0 }, { color:'#000000', isOpacityNode:true, position:1 } ] }, name:'Linear Smooth', pattern:null, shape:'linear', stampingMode:'blend opaque', textureBlend:0, webDitherTransparent:false });"); FWJavascript("fw.getDocumentDOM().setFillVector({x:"+Left+",y:"+Bottom+"}, {x:"+Left+", y:"+Top+"}, {x:"+Right+", y:"+Bottom+"});"); //添加效果 FWJavascript("fw.getDocumentDOM().applyEffects({ category:'UNUSED', effects:[ { EffectIsVisible:true, EffectMoaID:\"{5600f702-774c-11d3-baad0000861f4d01}\", ShadowAngle:315, ShadowBlur:5, ShadowColor:'#000000a6', ShadowDistance:0, ShadowType:0, category:'Shadow and Glow', name:'Inner Shadow' } ], name:'UNUSED' });"); //繪制第二個(gè)矩形 FWJavascript("fw.getDocumentDOM().addNewRectanglePrimitive({left:"+SLeft+", top:"+STop+", right:"+SRight+", bottom:"+SBottom+"},"+SRound+"); "); //填充第二個(gè)矩形 FWJavascript("fw.getDocumentDOM().setFill({ category:'fc_Linear', ditherColors:[ '#000000', '#000000' ], edgeType:'antialiased', feather:0, gradient:{ name:'cn_Custom', nodes:[ { color:'#000000', isOpacityNode:false, position:0 }, { color:'#ffffff', isOpacityNode:false, position:1 } ], opacityNodes:[ { color:'#000000', isOpacityNode:true, position:0 }, { color:'#000000', isOpacityNode:true, position:1 } ] }, name:'Linear Smooth', pattern:null, shape:'linear', stampingMode:'blend opaque', textureBlend:0, webDitherTransparent:false });"); //改變第二個(gè)矩形的填充方向 FWJavascript("fw.getDocumentDOM().setFillVector({x:"+SLeft+",y:"+SBottom+"}, {x:"+SLeft+", y:"+STop+"}, {x:"+SRight+", y:"+SBottom+"});"); //改變混合模式 FWJavascript("fw.getDocumentDOM().setBlendMode('screen');"); // End command and release system resources FWEndCommand(true, ""); }
出處:
責(zé)任編輯:藍(lán)色
上一頁(yè) 輸出到Fireworks MX測(cè)試并調(diào)試代碼 下一頁(yè) 打包你的插件
◎進(jìn)入論壇Photoshop、Fireworks版塊參加討論
|