Hello,
I am going to integrate smartfox to cocos2d-js, but i face some issues need to make clear.
Currently, i have successful intergate smartfox to cocos2d-x ( using c++ client api)
Now I need integrate it to cocos2d-js too. My expectation is I only need to write ONCE by javascript and able to compile on 3 platform html5, android and ios.
Cocos2d-js provide a solution to binding Js to C++, but SmartFox using boost library which is so complicate for binding-generator ( I guess so). I stuck on binding boost lib just now.
I know many people here are success to integrate it. Please help with with some advice or a right direction. Thank you!
Best regards,
Integrate Smartfox to cocos2d-js
Re: Integrate Smartfox to cocos2d-js
Hi,
if you're using Cocos2D-JS you should also use our Javascript client library. Not the C++ one.
You can go to our main download page, and download it:
http://smartfoxserver.com/download/sfs2x#p=client
The library is written in pure javascript and works very similarly to the other SmartFoxServer API. I would also recommend downloading our HTML5 Example Pack here:
http://smartfoxserver.com/download/sfs2x#p=examples
The Javascript documentation is found here:
http://docs2x.smartfoxserver.com/api-docs/jsdoc/
cheers
if you're using Cocos2D-JS you should also use our Javascript client library. Not the C++ one.
You can go to our main download page, and download it:
http://smartfoxserver.com/download/sfs2x#p=client
The library is written in pure javascript and works very similarly to the other SmartFoxServer API. I would also recommend downloading our HTML5 Example Pack here:
http://smartfoxserver.com/download/sfs2x#p=examples
The Javascript documentation is found here:
http://docs2x.smartfoxserver.com/api-docs/jsdoc/
cheers
Re: Integrate Smartfox to cocos2d-js
Hi there,
How about 2 native: android and ios but use javascript as the developing language?
How about 2 native: android and ios but use javascript as the developing language?
Re: Integrate Smartfox to cocos2d-js
Hi,
I am not an expert of Cocos2D-JS specifically, but the idea is that Cocos allows you to write your code in Javascript and then will compile your project for various platforms, including iOS and Android. Right?
If this is correct then our HTML5/JS library is pure Javascript code so it can compiled, along with your game JS code, to any of the platforms supported by Cocos2D-JS.
At least this is what I understand from this page:
http://www.cocos2d-x.org/wiki/Cocos2d-JS
cheers
I am not an expert of Cocos2D-JS specifically, but the idea is that Cocos allows you to write your code in Javascript and then will compile your project for various platforms, including iOS and Android. Right?
If this is correct then our HTML5/JS library is pure Javascript code so it can compiled, along with your game JS code, to any of the platforms supported by Cocos2D-JS.
At least this is what I understand from this page:
http://www.cocos2d-x.org/wiki/Cocos2d-JS
cheers
Re: Integrate Smartfox to cocos2d-js
Yes, HTML5/JS library is pure Javascript therefore It is only work on WEB not on NATIVE Android and iOS.
Cocos2d-js provide a mechanism called "jsb" allow javascript call native API.
I wonder if i could use JSB to call native API of smartfox too ?
Cocos2d-js provide a mechanism called "jsb" allow javascript call native API.
I wonder if i could use JSB to call native API of smartfox too ?
Re: Integrate Smartfox to cocos2d-js
Yes, I suppose that is possible.
Re: Integrate Smartfox to cocos2d-js
Do you have plan to support it officially ?
Re: Integrate Smartfox to cocos2d-js
I am not sure what you mean by that. If Cocos2D-JS can call native code you can use the official C++ API.
Sure the operation sounds a little bit convoluted since you have to write JS code for HTML and then wrap the native API calls... honestly it seems a bit of a convoluted system.
Why not using Cocos2D-x directly for the mobile versions? It seems like an easier process than wrapping all the JS code which calls the native code below... Just my impression.
cheers
Sure the operation sounds a little bit convoluted since you have to write JS code for HTML and then wrap the native API calls... honestly it seems a bit of a convoluted system.
Why not using Cocos2D-x directly for the mobile versions? It seems like an easier process than wrapping all the JS code which calls the native code below... Just my impression.
cheers
Re: Integrate Smartfox to cocos2d-js
yes, as you said that is convoluted progress.
By using JSB to allow javascript call native API have some limitations. And the boost library which is not simple C++ library for binding generator already. I was try to binding boost lib C++ first then your "Wrapper Smartfox" . But stuck at "boost binding process".
We intented to use Javascript to save time of developing, only write ONCE LOGIC and compile in various platforms. Of course using cocos2d-x separately is easier process.
By using JSB to allow javascript call native API have some limitations. And the boost library which is not simple C++ library for binding generator already. I was try to binding boost lib C++ first then your "Wrapper Smartfox" . But stuck at "boost binding process".
We intented to use Javascript to save time of developing, only write ONCE LOGIC and compile in various platforms. Of course using cocos2d-x separately is easier process.
Return to “SFS2X HTML5 / JavaScript API”
Who is online
Users browsing this forum: No registered users and 33 guests