Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccb使用Custom class报错 #5

Closed
aquariusgx opened this issue May 9, 2013 · 7 comments
Closed

ccb使用Custom class报错 #5

aquariusgx opened this issue May 9, 2013 · 7 comments

Comments

@aquariusgx
Copy link

ccb中Custom class不为空的情况,proxy:readCCBFromFile()这个方法会导致:
Assertion failed: (ccNodeLoadersIterator != this->mCCNodeLoaders.end()), function getCCNodeLoader, file /Users/guxin/Desktop/CocosDragonWtihLua/CocosDragonWtihLua/libs/extensions/CCBReader/CCNodeLoaderLibrary.cpp, line 67.

proxy:readCCBFromFile() 的实现部分ib->registerCCNodeLoader("", ProxyLayerLoader::loader()); 莫非因为第一个参数没有传进来注册导致的?手动增加参数后测试正常。

FYI:http://www.cocos2d-x.org/boards/18/topics/16740

@shawnclovie
Copy link
Owner

Lua中不能使用Custom class,所以请将那里设成空,把要使用的节点设定成Owner var并起名就好。
昨天修改的CCBProxy.cpp已经不再调用registerCCNodeLoader,之前这步操作完全没起作用。

@aquariusgx
Copy link
Author

多谢~

@wtyqm
Copy link
Contributor

wtyqm commented Jun 16, 2013

关于CocosBuilder lua bind的方式,我觉得官方js bind那种,一个interface对应一个脚本文件,自动将成员变量绑定到脚本里,在正规使用上有一定优势,同时也支持Custom class。我这里也写了个lua的对应实现。
不知您有没有想法包含这种方式?

@dumganhar
Copy link

@wtyqm
Copy link
Contributor

wtyqm commented Jun 16, 2013

@dumganhar
Very good, and thank for your remind.Is it publish in cocos2dx-2.1.4 ?
What about auto convert member variable type and custom property? I think this should add support in cocosbuilder cpp file.

@wtyqm
Copy link
Contributor

wtyqm commented Jun 16, 2013

@dumganhar
Oh, it's already support auto convert member variable type. Is it still ok for sub ccb file type ? And the second param proxy is LuaProxy ?

@shawnclovie
Copy link
Owner

There are different way to do same thing. Just pick which one that fit you.

Do more in C++ should more effective, I think. So I do more with C functions.
Every ccbi for LuaProxy, just like texture for CCSprite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants