[][求助]无法使用loader预先加载

Laya.loader.retryNum = 0;
var urls:Array = [
"res/mainpage/title.png",
"res/mainpage/q.png",
"res/mainpage/BtnNo.png",
"res/mainpage/BtnYes.png"
];
Laya.loader.load(urls, Handler.create(this, onAssetLoaded), Handler.create(this, onLoading, null, false), Loader.TEXT);

Laya.loader.on(Event.ERROR, this, onError);
 

private function onAssetLoaded(texture:Texture):void{
            //console.log("111: ");
            
            txt.visible=false;
            title = new Sprite();
            Laya.stage.addChild(title);
            title.graphics.drawTexture(Laya.loader.getRes("res/mainpage/title.png"));

            var titleT:Texture = Laya.loader.getRes("res/mainpage/title.png");

            if(titleT==null){
                trace("none");
            }
}
 
加载成功后纹理是空的
已邀请:

cuixueying

赞同来自:

LOADER.TEXT换成LOADER.IIMAGE试下

要回复问题请先

商务合作
商务合作