Egret HtmlText

// html文本
module game {
    export class HtmlDemo extends egret.DisplayObjectContainer {
        public constructor() {
            super();
            this.showHtml();
        }
        private showHtml() {
            var tx: egret.TextField = new egret.TextField;
            tx.width = 200;
            // u=true 下划线
            tx.textFlow = new egret.HtmlTextParser().parser("妈妈再也不用担心我在" +
            "Egret" +
            "里说一句话不能包含各种" +
            "" +
            "" +
            "" +
            "" +
            "、\n" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "" +
            "了!");
            tx.x = 10;
            tx.y = 90;
            
            this.addChild(tx);
        }
    }
}

 

你可能感兴趣的:(Egret)