動態文本rotation導致的文本消失問題

來源:互聯網
上載者:User

一個動態文本,當mc.rotation=30或者其他數值的時候,會發現動態文本消失了~

在時間軸上這麼寫吧:

var mySprite:Sprite=new Sprite();<br />var myText:TextField=new TextField();<br />myText.text="Anson";<br />myText.border=true;<br />mySprite.addChild(myText);<br />mySprite.x=stage.stageWidth*0.5;<br />mySprite.y=stage.stageHeight*0.5;<br />//myText.rotationZ=0;//等下把這個注釋去掉<br />addChild(mySprite);<br />stage.addEventListener(MouseEvent.MOUSE_MOVE,onMouse_Move);<br />function onMouse_Move(event:MouseEvent):void{<br /> mySprite.rotation=Math.atan2(mouseY-mySprite.y,mouseX-mySprite.x)/Math.PI*180;<br />}

 

我寫了這段代碼,一個容器包含了一個動態文本,然後把容器加入到顯示列表中,然後這個容器隨滑鼠來旋轉角度,會發現轉的時候裡面的動態文本會消失了~然後把上面的注釋去掉,就可以發現動態文本可以隨著容器來旋轉角度了~呵呵

 

以下是網上朋友的評論:

辦法是嵌入字型,或是bitmapdata拍照

其實使用fp10就可以直接讓動態文本旋轉了,而且也直接支援動態文本透明了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.