2011-09-03 5 views

답변

0

이 작업을 수행하는 간단한 방법은, 글꼴을 포함 텍스처를 생성하고 텍스처 비트 맵 마스크로 텍스트 필드를 설정하는 것입니다 사용할 수 있습니다

있었다
package { 
    import flash.display.*; 
    import flash.text.*; 

    /** 
    * @author george 
    */ 
    public class MaskText extends Sprite { 
     FontClass_123ffed0d5f76880; 
     FontClass_123ffed0d5f76880_arial; 

     public function MaskText() { 
      init(); 
     } 
     private function init():void{ 
      //make text 
      var tf:TextField = new TextField(); 
      tf.defaultTextFormat = new TextFormat('arial',32); 
      tf.embedFonts = true; 
      tf.border = false; 
      tf.selectable = false; 
      tf.text = "TEXT"; 
      //make texture 
      var tex:BitmapData = new BitmapData(tf.textWidth, tf.textHeight,false,0); 
      tex.perlinNoise(110, 110, 32, 64, true, true, 7); 
      //create bitmap and apply mask 
      var b:Bitmap = new Bitmap(tex); 
      b.mask = tf; 
      addChild(b); 
      addChild(tf); 
     } 
    } 
} 

Stackoverflow 꽤 비슷한 질문. 다른 솔루션 here을 확인하십시오.

관련 문제