[LayaAirIDE 2.0]内嵌模式创建scene,运行时报找不到json文件
我在一个空白工程里面创建了一个scene并使用内嵌模式,界面只是简单显示了一个label,在运行时,报错“laya.core.js:22326 Uncaught Can not find scene:Hello.scene”,原因是在/bin/目录下找不到场景对应的描述文件Hello.json。这让我很不理解,内嵌模式的描述不是已经清楚的写在类里面了吗,并使用createView()进行创建,并且都是ide自动生成的代码。
export module ui {
export class HelloUI extends Scene {
public static uiView:any ={"type":"Scene","props":{"width":640,"height":1136},"compId":2,"child":[{"type":"Label","props":{"y":64,"x":214.5,"width":211,"text":"label","styleSkin":"comp/label.png","height":67},"compId":3}],"loadList":["comp/label.png"],"loadList3D":[]};
constructor(){ super()}
createChildren():void {
super.createChildren();
this.createView(HelloUI.uiView);
}
}
REG("ui.HelloUI",HelloUI);
}
export module ui {
export class HelloUI extends Scene {
public static uiView:any ={"type":"Scene","props":{"width":640,"height":1136},"compId":2,"child":[{"type":"Label","props":{"y":64,"x":214.5,"width":211,"text":"label","styleSkin":"comp/label.png","height":67},"compId":3}],"loadList":["comp/label.png"],"loadList3D":[]};
constructor(){ super()}
createChildren():void {
super.createChildren();
this.createView(HelloUI.uiView);
}
}
REG("ui.HelloUI",HelloUI);
}
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复