Export HTML5 to Javascript Binding

Export HTML5 to Javascript Binding
0.0 0


Any tutorials?

I’m new to even Cocos2d, HTML5 is my starting point on here and who like me must have the question that how to export it and import to other native platforms directly.


I’m not sure I fully understand “HTML5 to JavaScript Binding”, but if you’re looking at getting your HTML5 project onto other native platforms, I can provide some feedback for the BlackBerry platforms (BBOS Smartphones, PlayBook, and the upcoming BlackBerry 10.) There’s actually a lot of information on this available here:

With the WebWorks SDK, you can package your HTML5 (HTML, JavaScript, CSS) into an app that runs completely from a device. All the process really is at heart, is creating a ZIP of the project and running a conversion tool to get your BlackBerry application. There’s even a handy emulator if you want to test directly in your browser. No recoding or anything like that, just take your HTML5 project and you’re 99% of the way there.

If you’re interested, I’d start here:

And if you have any more questions, by all means just let me know. My expertise is more with BlackBerry, but perhaps others here could advise on other platforms? (If I’ve missed the question, apologies. I don’t mean for this to be a plug or anything, but that was my understanding of the question and I thought I’d chip in some help for at least one platform.)


Thanks for your information! Sorry but my question is about “HTML5 project to C++ project with Javascript binding on each platforms”.
I understand that cocos2d-html5 restrictively works on Webkit or some engines like that through mobile frameworks like Phone Gap that to be used for the native support purpose.


Ah I understand now. I’ve only ever seen C*+ to HTML5 via Emscripten, not the other way. With HTML5 you generally already have the cross-platform covered, is it performance that you’re after by converting to C*+ for the native app? In my experience the performance if comparable up to a (fairly high) point. Unfortunately I don’t have any experience with HTML5 to C++, but I’m curious about the ultimate goal of the conversion as it may be something for more devs to consider.


Tutorials are yet to be released, as we still don’t feel that the js binding is stable enough for release in current stage.

In case you are wondering how it works, it works by adding a javascript interpreter to cocos2d-x and cocos2d-iphone game engine, which will run the javascript logic, existing native engine classes are then binded to equivalent js objects, for example, if you create a sprite with cc.Sprite.create(‘mysprite.png’); this instruction will be sent to the native engine.

long story short, if you dont edit any of the classes in cocos2d-html5, your game will be plug and play on cocos2d-x and cocos2d-iphone. you may even extend classes if you want


That’s great!
So now all we have to do is creating something only on HTML5. DANKE