先上一张效果图
然后是LoadingUI里的代码
class LoadingUI extends egret.Sprite implements RES.PromiseTaskReporter {
public constructor() {
super();
this.createView();
}
private bg1:egret.Bitmap;
private bg2:egret.Bitmap;
private loadingicon:egret.Bitmap;
private bitmapText :egret.BitmapText;
private createView(): void {
// 加载loadingBg图
let loadingbg:egret.Bitmap = new egret.Bitmap()
loadingbg.texture = RES.getRes("loading_bg_jpg");
loadingbg.width = 640 ;
loadingbg.height = 1136 ;
this.addChild(loadingbg);
this.bg1= new egret.Bitmap()
this.bg1.texture = RES.getRes("loading_json.loading_bar1_png");
this.bg1.anchorOffsetX = this.bg1.width