Html5 - Tidbits - Epic Wiki
# Html5 - Tidbits
This page is meant to serve as an archive for assorted information regarding HTML5 development.
# Exporting C functions to Javascript
Disclaimer: this is a living document based on current research and experience. This currently does not work.
Somewhere in the project, define a global C function to be called by Javascript
extern "C" { #if PLATFORM_HTML5_BROWSER DEFINE_LOG_CATEGORY_STATIC(LogHTML5, Log, All); void my_func( const char* _string, int _number ) { #ifdef __EMSCRIPTEN_TRACING__ // Log to emscripten emscripten_log( EM_LOG_CONSOLE, TEXT("my_func( %s, %d )"), _string, _number ); #endif // Log to UE console UE_LOG( LogHTML5, Verbose, TEXT("my_func( %s, %d )"), _string, _number ); } #endif }
Append the C function name with a prefixed '_' to this EXPORTED_FUNCTIONS array
// File
//
The Javascript that handles the web interface gets pulled from a template during build, so any changes should be done to that.
// File
//
Retrieved from "https://wiki.unrealengine.com/index.php?title=Html5_-_Tidbits&oldid=17912"