cocos2d-console

I use cocos2d-console to compile my js files to jsc file, and how to use the jsc file in c++? Who has experience of this??

the function ( JS_ExecuteScript ) need a param of JSScript object, and how to convert jsc file to JSScript? Can somebody can help me ?

Please refer to the README file at https://github.com/cocos2d/cocos2d-console/blob/develop/README.md
Also, you could get help from python cocos2d.py jscompile —help.

Yes, I have compiled js to jsc file follow the help, but how to load the jsc file to game, and before the code is like this:
ScriptingCore::getInstance()->runScript(“wxg-jsb.js”);
now if can do like this: ScriptingCore::getInstance()->runScript(“wxg-jsb.jsc”)?
I try do like this, but wrong, could you gave me some same to load jsc file to game? Thank you very much

James Chen wrote:

Please refer to the README file at https://github.com/cocos2d/cocos2d-console/blob/develop/README.md
Also, you could get help from python cocos2d.py jscompile —help.

If you didn’t use `-c` opinion, the generated jsc files will have the same folder structure as the original one.
Then you just need to invoke `ScriptingCore::getInstance()->runScript(“wxg-jsb.js”)` is enough, no need to call `runScript(“wxg-jsb.jsc”)`.

Justin Zhang wrote:

Yes, I have compiled js to jsc file follow the help, but how to load the jsc file to game, and before the code is like this:
ScriptingCore::getInstance()->runScript(“wxg-jsb.js”);
now if can do like this: ScriptingCore::getInstance()->runScript(“wxg-jsb.jsc”)?
I try do like this, but wrong, could you gave me some same to load jsc file to game? Thank you very much
>
>
James Chen wrote:
> Please refer to the README file at https://github.com/cocos2d/cocos2d-console/blob/develop/README.md
> Also, you could get help from python cocos2d.py jscompile —help.

Hi,James,
Thanks for you reply, I used the `-c` option to compile the js file now, and I don’t know how to use the compiled jsc file.
I’ll remove the `-c` option and retry again !

James Chen wrote:

If you didn’t use `-c` opinion, the generated jsc files will have the same folder structure as the original one.
Then you just need to invoke `ScriptingCore::getInstance()->runScript(“wxg-jsb.js”)` is enough, no need to call `runScript(“wxg-jsb.jsc”)`.
>
Justin Zhang wrote:
> Yes, I have compiled js to jsc file follow the help, but how to load the jsc file to game, and before the code is like this:
> ScriptingCore::getInstance()->runScript(“wxg-jsb.js”);
> now if can do like this: ScriptingCore::getInstance()->runScript(“wxg-jsb.jsc”)?
> I try do like this, but wrong, could you gave me some same to load jsc file to game? Thank you very much
>
>
> James Chen wrote:
> > Please refer to the README file at https://github.com/cocos2d/cocos2d-console/blob/develop/README.md
> > Also, you could get help from python cocos2d.py jscompile —help.

throw a error this._super() is not a function in jsc file . help

daniel luan wrote:

throw a error this._super() is not a function in jsc file . help

You should also compile script/javascript/bindings/js/XXX.js.

I obfuscate all the code into game.js, then jscc game.js to game.jsc.
Only one file left…