如何使用actionscript 3(使用flex 4)繪製流暢的線條?如何在actionscript 3(Flash)中繪製流暢的線條
我的意思是:我做這樣的事情:
var grap:Graphics = this.display.graphics;
grap.lineStyle(8, 0xFF0000, 1, true, "normal", CapsStyle.ROUND);
grap.moveTo(180,330);
grap.lineTo(200,130);
但結果是這樣的:
http://sub.ited.nl/try/ :(
線條的邊緣非常脆,我怎麼能改善這個 ?特別是通過吐溫畫線時,它看起來像一個喝醉酒的人走在人行道上;)...
補間代碼繪製線:
var grap:Graphics = this.display.graphics;
grap.lineStyle(8, 0xFF0000, 1, true, "normal", CapsStyle.ROUND);
grap.moveTo(220,330);
new Tween(this, [220, 330], [240, 130]);
而在onTweenUpdate方法:
this.display.graphics.lineTo(values[0], values[1]);
請對此一些建議嗎?
順便說一句:如何才能最好地移除flash對象的默認背景? (灰色背景)。 我有這個在我的index.mxml:
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="600"
addedToStage="start()" styleName="plain" backgroundImage="{null}">
但我看到一個閃爍的頻率(以開發模式),這意味着我第一次看到默認的灰色背景,然後一塊白一塊...
在此先感謝
順便提一句,您可能想要提出一個有關背景的新問題,標記爲「Flex」 - 因爲該灰色背景是由Flex框架繪製的,而不是Flash本身。 Flash本身的「真實」背景取決於你如何嵌入SWF(即,如果你正在編寫HTML,它是你的'object'和'embed'標籤的一個參數)。 – fenomas 2010-06-21 10:09:01