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

能否让promelo-jsclient客户端同时支持html5和cocos2d jsb. #4

Open
zxh1982 opened this issue Oct 14, 2013 · 5 comments
Open

Comments

@zxh1982
Copy link

zxh1982 commented Oct 14, 2013

我将库放到cocos2d jsb环境下报错,没有window对象.
/Users/zxh/Library/Application Support/iPhone Simulator/6.1/Applications/67238146-A944-45CB-A45F-0ED4DA687739/Library/Caches/ccb/pomelo-client.js:5:0 ReferenceError: window is not defined

能否支持非浏览器环境呢?

@zyfu0000
Copy link

同问~

@py8765
Copy link
Contributor

py8765 commented Nov 4, 2013

这个应该不行

@zyfu0000
Copy link

zyfu0000 commented Nov 4, 2013

我有将websocket-client生成的build.js抽离出来供cocos2d-x jsb使用,没有问题,cocos2d-x有websocket的jsb。不过只是测试了一下跟服务器的链接,是否完全能用还不知。

介于Express的方便性,游戏的html5版本,我觉得还是应用Pomelo建立的工程来做,可以把cocos2d-html5的作为渲染引擎使用。那样的话就不存在需要Pomelo的js文件要通用了,可以在C语言版本的libPomelo基础上写jsb供iOS和Android使用。

个人理解,如有错误,请指出。

@IcePower
Copy link

@zyfu0000 请问这个build.js是什么呀,要怎么抽离呢?

@py8765
Copy link
Contributor

py8765 commented Nov 29, 2013

build.js是用component组件合成的一个js文件。

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