2

I need to know if the cocos2d-js (cocos2d javascript) could build a real native application and not just use a webview to display the content.

what i exactly need to know, if the animations and all parts of the game logic will be transformed to some native code using JSB.

i searched online, and wasn't able to find any clear answer, and the official cocos2D-js documentation is really poor and don't give much details.

Sorry, it is my first question here, hope that i followed the rules, and sorry for my English.

ckh
  • 23
  • 5
  • 1
    Did you read the readme? This is discussed extensively: https://github.com/cocos2d/cocos2d-js/blob/develop/README.md – Aaron Brager Apr 23 '15 at 13:35
  • @AaronBrager sure i read the readme, but wasn't able to find any clear answer, and the documentation is really poor. – ckh Apr 23 '15 at 13:42
  • You'll probably get a better answer in the official forums, but as far as I know Spidermonkey is used, I'm not entirely sure what optimizations the JSB compiler uses, I believe the parts you write in C++ in a JSB project will be compiled to native code, but the JS code will be ran in Spidermonkey (as far as I know). – Sebastián Vansteenkiste Apr 24 '15 at 13:04
  • @SebastiánVansteenkiste thank you, but currently i'm struggling in their forum and wiki trying to find an answer. cocos-2d js documentation is very limited and totally not clear, i am not blaming them, i know that it still counted as a new framework and under continuous development, so maybe when they produce a stable version they will try to make things clearer. Also, i am not sure as well that spidermonkey is used, especially when i think about some old operating systems which does not truly support HTML5. – ckh Apr 24 '15 at 14:28
  • The idea is that Spidermonkey *is a native app*, so it is used to interpret the JS on any device that's supported. Picture it like how Java uses it's Virtual Machine to run on any device. And really, if you can't find it you should just ask it under the Cocos2d-x/JavaScript category in the forums, someone will surely know for sure what to answer you. – Sebastián Vansteenkiste Apr 24 '15 at 17:42

1 Answers1

3

As the comments already suggest, it's not using a webview, it's native. These two charts from cocos2d-x.org show it: SpiderMonkey goes directly to the NDK (C++ code). enter image description here enter image description here

Michael
  • 6,823
  • 11
  • 54
  • 84