function showHtmlText(errorMsg:String):void
{
var fmt:TextFormat = new TextFormat();
fmt.color = 0xffffff;
fmt.size = 16;
fmt.font = "微軟雅黑";
var tf: TextField = new TextField();
tf.multiline = true;
tf.width = 280;
tf.height = 120
tf.antiAliasType = flash.text.AntiAliasType.ADVANCED
tf.htmlText = errorMsg;
var bmd:BitmapData=new BitmapData(tf.width,tf.height,true,0);
bmd.draw(tf);
var tfImg:Image = new Image(Texture.fromBitmapData(bmd,false));
tfImg.x = 25;
tfImg.y = 40;
this.addChild(tfImg);
}
隨便看看記錄下來的,就是這個思路了fmt可以去掉的,自己拼接errorMsg加上字體字號顏色等等等等的
starling 中如何使用htmltext
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.