Egret 混合样式文本

//混合样式文本
module game{
    export class iTextDemo extends egret.DisplayObjectContainer{
        public constructor(){
            super();
            this.showText();
        }
        private showText():void{
            var tx:egret.TextField = new egret.TextField;
            tx.width = 400;
            tx.x = 10;
            tx.y = 10;
            tx.textColor = 0;
            tx.size = 20;
            tx.fontFamily = "微软雅黑";
            tx.textAlign = egret.HorizontalAlign.CENTER;
            tx.textFlow = >[
                {text:"Text in\n",style:{"size":20}},
                {text:"Egret",style:{"fontFamily":"Impact"}}
            ];
            this.addChild(tx);
        }
    }
}

 

你可能感兴趣的:(Egret)