[]添加fairygui使用fairygui.UIPackage.addPackage ( "res/Bag" )后可以正常跑,发布到微信小游戏出错
private function beginLoad():void {
//加载引擎需要的资源
//Laya.loader.load("res/atlas/comp.atlas", Handler.create(this, onLoaded));
Laya.loader.load
(
[
{ url: "res/atlas/comp.atlas" , type: Loader.ATLAS },
{ url: "res/Bag@atlas0.png", type: Loader.IMAGE },
{ url: "res/Bag.fui", type: Loader.BUFFER }
],
Handler.create(this, onLoaded)
);
}
private function onLoaded():void {
//实例UI界面
var testView:TestView = new TestView();
Laya.stage.addChild(testView);
fairygui.UIPackage.addPackage ( "res/Bag" );
Laya.stage.addChild ( fairygui.GRoot.inst.displayObject );
fairygui.GRoot.inst.addChild ( fairygui.UIPackage.createObject( "Bag", "Main" ) );
}
//加载引擎需要的资源
//Laya.loader.load("res/atlas/comp.atlas", Handler.create(this, onLoaded));
Laya.loader.load
(
[
{ url: "res/atlas/comp.atlas" , type: Loader.ATLAS },
{ url: "res/Bag@atlas0.png", type: Loader.IMAGE },
{ url: "res/Bag.fui", type: Loader.BUFFER }
],
Handler.create(this, onLoaded)
);
}
private function onLoaded():void {
//实例UI界面
var testView:TestView = new TestView();
Laya.stage.addChild(testView);
fairygui.UIPackage.addPackage ( "res/Bag" );
Laya.stage.addChild ( fairygui.GRoot.inst.displayObject );
fairygui.GRoot.inst.addChild ( fairygui.UIPackage.createObject( "Bag", "Main" ) );
}
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Laya_XSN
赞同来自:
J
赞同来自:
https://ask.layabox.com/question/10252
https://github.com/jindw/xmldom