I am trying to call javascript function from c++ using the scriptingCore API. But I could not find any guideline for this. These are the closest things I found on the topic:
Can anybody give me a general guideline for using scriptingCore APIs?
I am trying to call javascript function from c++ using the scriptingCore API. But I could not find any guideline for this. These are the closest things I found on the topic:
Can anybody give me a general guideline for using scriptingCore APIs?
Replied to your other thread.
Hi, I am working on creating a game on windows 10 (64-bit).
IDE: MSVS Community 2015.
I have made a frame/layout of the game with coco2d-x c++ framework.
The web version of the game was already developed sometime back and I want to call some functions from the js file which was developed during the web game development. I am unsure how to call those functions and display the values inside labels created in c++ code.
JS-function:
This is some dummy js object:
var DummyObj={
getRandomNum: function() {
var c=Math.round(Math.random());
return c
}
};
Let’s say I want to get a random number from the above object function and display that inside a Label node in my c++ code.
How can I do that ?
FYI, the project which I have created with c++, there is no class “ScriptingCore” in that project. This is only created which I create a JS project.
Any help will be greatly appreciated.