設置 BitmapLabel 方式
MainUISkin.exml
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="edwin.MainUISkin" xmlns:e="http://ns.egret.com/eui">
    <e:Rect fillColor="0x000000" width="100%" height="100%" />
    <!-- Group 繼承自 DisplayObjectContainer 所以擁有加入子物件特性. 這裡設定滿版 -->
    <e:Group width="100%" height="100%">
        <!-- 使用 BitmapFont -->
        <e:BitmapLabel id="lb_show" font="myFont_fnt" text="12345" />
    </e:Group>
</e:Skin>
MainUI.ts
namespace edwin {
    export class MainUI extends eui.Component {
        private lb_show: eui.BitmapLabel;
        protected createChildren(): void {
            super.createChildren();
            this.percentWidth = this.percentHeight = 100;
            this.lb_show.text = "28825252";
        }
    }
}
字體生成方式請參考:Texture Merger 軟體用法
 
沒有留言:
張貼留言