Hi,
I need to be able to call C++ (or blueprint) functions from JavaScript. I know that Unreal uses Emscripten to pack the C++ code to HTML5 build. It should be integrated in Unreal, but it is still not clear to me how to actually use it. I am able to build my Blueprint / C++ app in HTML5 and run it, but I just don't understand how to call the C++ functions. According to this thread, it should be possible:
https://answers.unrealengine.com/que...avascript.html
But what I don't get is:
- PLATFORM_HTML5_BROWSER is not defined at all. No matter if I run from editor or package the APP as HTML5, it is not defined. Am I supposed to do it myself? Because I would expect it to behave similarly as for example PLATFORM_WINDOWS...
- those EMSCRIPTEN_KEEPALIVE and other EMSCRIPTEN macros are not defined. Am I suppose to include anything? I tried to include <emscripten.h>, but that fails right away when trying to build the editor so I cannot even get to packaging the app for HTML5.
The best thing would be if there was some comprehensive tutorial for JS / C++ integration, but that doesn't seem to be the case. Or is it?
Thanks!
I need to be able to call C++ (or blueprint) functions from JavaScript. I know that Unreal uses Emscripten to pack the C++ code to HTML5 build. It should be integrated in Unreal, but it is still not clear to me how to actually use it. I am able to build my Blueprint / C++ app in HTML5 and run it, but I just don't understand how to call the C++ functions. According to this thread, it should be possible:
https://answers.unrealengine.com/que...avascript.html
But what I don't get is:
- PLATFORM_HTML5_BROWSER is not defined at all. No matter if I run from editor or package the APP as HTML5, it is not defined. Am I supposed to do it myself? Because I would expect it to behave similarly as for example PLATFORM_WINDOWS...
- those EMSCRIPTEN_KEEPALIVE and other EMSCRIPTEN macros are not defined. Am I suppose to include anything? I tried to include <emscripten.h>, but that fails right away when trying to build the editor so I cannot even get to packaging the app for HTML5.
The best thing would be if there was some comprehensive tutorial for JS / C++ integration, but that doesn't seem to be the case. Or is it?
Thanks!
Comment