[LayaAir 1.0]微信小游戏图片加载不出来

var resArray = [{
url: "ui/BG/Start.png",
type: Laya.Loader.IMAGE
},
{
url: "ui/BG/load.png",
type: Laya.Loader.IMAGE
},
{
url: "res/atlas/comp.atlas",
type: Laya.Loader.ATLAS
},
{
url: "res/atlas/ui.atlas",
type: Laya.Loader.ATLAS
},
];
Laya.loader.load(resArray, Laya.Handler.create(this, this.onLoaded));
Laya.loader.create("ui/BG/play-bg.png", Laya.Handler.create(this, this.onLoaded));
在微信小游戏里面可以显示,但是实体机子上就无法显示"ui/BG/play-bg.png"这一张图,其他图片可以 ,下面附上背景demo

//创建背景1
this.bg1 = new Laya.Sprite();
//加载并显示背景图
this.bg1.loadImage("ui/BG/play-bg.png", 0, 0, 720, 5120);
//把背景图显示在容器内
this.addChild(this.bg1);
//创建背景2
this.bg2 = new Laya.Sprite();
//加载并显示背景图
this.bg2.loadImage("ui/BG/play-bg.png", 0, 0, 720, 5120);
//更改背景2的位置,放在背景1的上边
this.bg1.pos(0, -3840);
this.bg2.pos(0, -8960);
//把背景图显示在容器内
this.addChild(this.bg2);
//创建一个帧循环,更新容器的位置
Laya.timer.frameLoop(1, this, this.onLoop);
补充:在游戏开始游戏中loader的加载方法也用了,就是没有。
已邀请:

谭皓月

赞同来自:

解决了问题是,加载的图片高度不能太大,原先720*5120的图片不行,但是720*1280的可以

要回复问题请先

商务合作
商务合作