Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 600 Bytes

File metadata and controls

20 lines (14 loc) · 600 Bytes

GDScriptToC++

A wrapper class to expose GDNative C++ functions to GDScript when compiling with Emscripten.

Use

  1. Copy the contents of lib.cpp to local version.

  2. Add the following function to your module class:

template <typename... Args>
emscripten::function wrapper(const String &func, Args &&...args) {
    return emscripten::function(func, std::forward<Args>(args)...);
}
  1. Add <emscripten/bind.h> to your module.

  2. Call C++ functions from main.gd.

  3. Compile project to WASM with Emscripten.