About cocostudio loading UI json CCUIHELPER undeclared problem

查看官方的文档,在文档的最后添加了如何加载项目。如下代码:

UILayer* ul =UILayer::create();
ul->addWidget(CCUIHELPER->createWidgetFromJsonFile("UIEditorTest_1.json"));

但是添加了以后,已经添加相关的头文件及命名空间,无法编译通过,一直是CCUIHELPER是未声明的。

于是查看TestCpp是如何添加json文件,发现使用的是另外一种方式:

UILayer* ul =UILayer::create();
 UILayout* layout= dynamic_cast<UILayout*>(GUIReader::shareReader()->widgetFromJsonFile("TestUiApp_1.json"));
 ul->addWidget(layout);

修改如上面的方式,则可以编译通过,运行成功

912sy.com download resources are from the network, only for learning and reference use, the copyright belongs to the original author, do not use for commercial purposes, please remove yourself within 24 hours after downloading.
If the content published on this site inadvertently violates your rights and interests, please contact us and the site will be deleted within one business day.If you encounter any problems please contact customer service QQ:2385367137
912sy " About cocostudio loading UI json CCUIHELPER undeclared problem