在LayaUISample.js里面是这样写的
var LayaSample = (function(){
(function(){
//初始化引擎
Laya.init(800,600);
//设置背景颜色
Laya.stage.bgColor = "#ffcccc";
//加载资源
Laya.loader.load("res/atlas/comp.atlas",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS)
})();
function onLoaded(){
//实例化
var tempBG=new background();
Laya.stage.addChild(tempBG);
}
})();
在background.js里是这样写的
var background = (function (_super) {
function background() {
background.super(this);
}
Laya.class(background,"background",_super);
return background;
})(ui.backgroundUI);
backgound.ui也在场景编辑器里编辑并导出了。
然后运行的时候就会出错如下图
求解答