Skip to Content
defold-typescript libraries
defold (official)

defold/codepad

A browser-based Defold code editor with live preview and console, usable as a stand-alone page or embedded in another web page. It includes an HTML5 template, static web resources, attachable go.script and gui.gui_script files, and the codepad.codepad Lua module.

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

  • GitHub: defold/codepad — pinned to 1.2.0 (released while Defold 1.2.175 was current)
    1. Pick a release from defold/codepad releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Set codepad/template.html as the HTML5 template.
    3. Add /codepad/bundle_resources/ to Bundle Resources.
    4. Require codepad.codepad from a script.
    5. Forward codepad.init(self, scenes), codepad.update(self, dt) and codepad.on_message(...) from the script's lifecycle functions.

Engine APIs

It runs only in a browser and talks to the page through html5. Each editable scene is loaded through a collectionproxy.

On this page