[][求助]无法使用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");
}
}
加载成功后纹理是空的
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");
}
}
加载成功后纹理是空的
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
cuixueying
赞同来自: