你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
1567600631用户
赞同来自:
小高
x_raizo
阿Ray
要回复问题请先登录
5 个回复
1567600631用户
赞同来自:
// img.skin = "A0_Common_atlas0.png";
console.error("Dddd")
Laya.stage.addChild(img);
Laya.loader.load("A0_Common_atlas0.ktx",new Laya.Handler(this,function(e){
debugger
}))
返回false 官网的例子也是这样加载的 但是在微信小游戏上失败了
小高
赞同来自:
x_raizo
赞同来自:
阿Ray
赞同来自:
x_raizo
赞同来自:
public function _loadHttpRequest(url, contentType, onLoadCaller, onLoad, onProcessCaller, onProcess, onErrorCaller, onError){
if(Laya.MiniFileMgr && Laya.MiniFileMgr.isFile(url)){
//从磁盘读取缓存的文件
Laya.MiniFileMgr.fs.readFile({
filePath: url,
success: function(params:*) {
// 将读取到的data传递给LayaAir引擎进行处理
if(params.errno == 0)
{
onLoad.call(onLoadCaller, params.data);
}else{
console.error('文件读取失败,MiniFileMgr.fs.readFile(error=1):', url, onLoadCaller.sourceUrl);
}
},
fail: function(res:*) {
console.error('文件读取失败,MiniFileMgr.fs.readFile(error=2):', res, url, onErrorCaller.sourceUrl);
onError.call(onErrorCaller, res);
}
});
}else{
if (Browser.onVVMiniGame || Browser.onHWMiniGame) {
this["_http"] = new HttpRequest();
}
else {
if (!this["_http"])
this["_http"] = new HttpRequest();
}
onProcess && this._http.on(Event.PROGRESS, onProcessCaller, onProcess);
onLoad && this._http.on(Event.COMPLETE, onLoadCaller, onLoad);
this["_http"].on(Event.ERROR, onErrorCaller, onError);
this["_http"].send(url, null, "get", contentType);
}
}