[]微信小游戏wxmin图片加载有点问题

	MiniFileMgr.copyFile=function(tempFilePath,readyUrl,callBack){
var temp=tempFilePath.split("/");
var tempFileName=temp[temp.length-1];
var fileurlkey=readyUrl.split("?")[0];
var fileObj=null
        var fileObj=MiniFileMgr.getFileInfo(readyUrl);

// 这行会导致图片经常加载不出来,如果赋值为null就正常了
		var saveFilePath=MiniFileMgr.getFileNativePath(tempFileName);
MiniFileMgr.fs.copyFile({srcPath:tempFilePath,destPath:saveFilePath,success:function (data){
console.log(data, fileObj)
if (!fileObj){
MiniFileMgr.onSaveFile(readyUrl,tempFileName);
callBack !=null && callBack.runWith([0]);
}else {
console.log(fileObj.readyUrl == readyUrl, 'zhege')
if (fileObj.readyUrl !=readyUrl)
MiniFileMgr.remove(tempFileName,readyUrl,callBack);
}
},fail:function (data){
callBack !=null && callBack.runWith([1,data]);
}});
}
已邀请:

kezhiyu

赞同来自:


console.log(Laya)
Laya.MiniAdpter.init()
Laya3D.init(0, 0, true);
Laya.stage.scaleMode = Laya.Stage.SCALE_FULL;
Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;

var scene = Laya.stage.addChild(new Laya.Scene());
if(false) {
eval(23)
}
console.log(wx.request)
//初始化照相机
var camera = scene.addChild(new Laya.Camera(0, 0.1, 100));
camera.transform.translate(new Laya.Vector3(0, 2, 5));
camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false);
camera.clearColor = null;

//方向光
var directionLight = scene.addChild(new Laya.DirectionLight());
directionLight.color = new Laya.Vector3(0.6, 0.6, 0.4);
directionLight.direction = new Laya.Vector3(1, -1, -1);
Laya.Stat.show(0,30)
var box = scene.addChild(new Laya.MeshSprite3D(new Laya.BoxMesh(0.5, 0.5, 0.5)));
console.log(3)
var boxMat = new Laya.StandardMaterial();

boxMat.diffuseTexture = Laya.Texture2D.load("https://s2.d2scdn.com/2018/1/2 ... 6quot;);
box.meshRender.material = boxMat;
// var ape = new Laya.Sprite()
// Laya.stage.addChild(ape)
// ape.loadImage('https://s2.d2scdn.com/2018/1/2/474ebb47-f3af-4426-bc07-848524d9beb6/timg.jpg')
// console.log(123120, ape)

// Laya.loader.load('res/mao.jpg', Laya.Handler.create(this, function (){
// var t = Laya.loader.getRes('res/mao.jpg')
// console.log(t)
// var a = new Laya.Sprite()
// a.graphics.drawTexture(t, 0,0)
// a.scaleX = 0.3
// a.scaleY = 0.4
// a.pos(0,300)
// Laya.stage.addChild(a)
// }))
// ape.pos(100, 200)

// var c = -15
// Laya.timer.frameLoop(40, null, function () {
// c += 0.00001
// console.log(c)
// camera.transform.rotate(new Laya.Vector3(c, 0, 0), true, false);
// });

要回复问题请先

商务合作
商务合作