Skip to Content
defold-typescript libraries
defold (official)

defold/extension-html5

An example native extension for the HTML5 platform showing plain C++ code, a prebuilt Emscripten library, inline JavaScript through EM_ASM, and an Emscripten JavaScript library. It registers an html5nativeext Lua module with demonstration functions such as html5nativeext.multiply, html5nativeext.fibonacci and html5nativeext.get_user_data.

Lua API not typed — upstream ships no .script_api, so resolve skips it.

  • GitHub: defold/extension-html5 — pinned to 141feb6
    1. This repo publishes no releases or tags. Add a commit archive URL — for the pinned commit, https://github.com/defold/extension-html5/archive/141feb6a0d5cf0cbf2a8dc8640628539ba12270a.zip — to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Build the project for HTML5; the repository is an example project rather than a packaged library.
    3. Call the module's functions as its main.script does, including polling html5nativeext.get_user_data for data set from the web page.