Can cocos2d-js embedded application go back to C ++?

I am exploring the possibility of using cocos2d-js by inserting it as a view inside an existing iOS application. To do this, I will need a two-way communication between cocos2d and the surrounding application.

After some initial research, I decided that using ScriptingCorecan call in , using ScriptingCore:

ScriptingCore* sc = ScriptingCore::getInstance();
jsval outVal;
sc->evalString("function()", &outVal);

My question is to do the opposite. Is it possible (for example, in response to user input) to call back from cocos2d-js in C ++? Ideally, there would be a way to register a callback using ScriptingCorethat which can be called from JavaScript.

+4
source share
1

, , , . , , SuperSuraccoon Bluetooth git , , -, ++ JS-.

+1

Source: https://habr.com/ru/post/1542998/


All Articles