0
A
回答
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。
0
相關問題
- 1. 如何將紋理應用到glutSolidCube
- 2. DirectX 10將紋理繪製到紋理
- 3. iOS + SceneKit:如何將紋理着色器應用於紋理?
- 4. 使用C#在Direct X中將紋理渲染到紋理中
- 5. DirectX應用紋理
- 6. 將顏色應用於Open-GL紋理
- 7. 如何將紋理應用於THREE.ExtrudeGeometry?
- 8. 的DirectX:如何將效果應用到與ID3DXSprite.Draw繪製紋理(..)
- 9. 將紋理應用到文本並保存c#wpf
- 10. OpenGL,將紋理從圖像應用到等值面
- 11. Android - 將位圖紋理應用到API繪圖例程
- 12. 將DirectX着色器應用到XNA中的旋轉紋理
- 13. 將紋理應用到SVG並動態更改組件
- 14. 將xna中的紋理複製到另一個紋理中
- 15. 將lwjgl紋理合併到紋理圖集
- 16. 將新紋理加載到已定義的紋理名稱中
- 17. 應用紋理筆畫CGContextStrokePath
- 18. 應用紋理電網
- 19. 如何在運行時更新starling movieclip中的紋理
- 20. 到RGBA紋理
- 21. 將紋理應用到多維數據集,立方體的每個表面上的不同紋理
- 22. 在OpenGL中將紋理映射到VBO
- 23. 無法將紋理映射到對象
- 24. 將OpenGL FBO紋理渲染到GLXPixmap
- 25. Three.js - 將紋理綁定到粒子
- 26. 將紋理映射到mayavi網格
- 27. 將紋理從GPU複製到CPU
- 28. 將紋理加載到OpenGL 2.0中
- 29. FFMPEG到OpenGL紋理
- 30. 無法將嵌入的MovieClip投射到MovieClip類型