A GDExtension, using Ultralight, to render HTML.
- Godot 4.3+
- Ultralight 1.4.0 Beta
Platform | x64 | arm64 | x32 |
---|---|---|---|
Windows | ✅ | ❌ | |
Linux | ✅ | ❌ | |
Mac | ✅ | ✅ | ❌ |
✅ = Successfully ran the demo project.
⚠️ = Supported, but not tested.
❌ = Not supported.
- What can this plugin do?
- What's left to do?
- Limitations
- Prerequisites
- Project Structure
- Building
- JS Interop
- Render HTML & CSS, with JS capabilities.
- HTML Inspector
- Mouse & Keyboard Input
- JS Interop
- GDScript Support
- Accelerated Views. IE. GPU based rendering.
- ImageSource. IE. RenderTargets.
- Make sure remote websites can't access C++ code via JS interop.
- Live code updates. (Allow for html to update in the editor when file changed)
- ?? More will arrise I assume ??
Ultralight works for most web features. Check out the missing features.
Some of the notable limitations are:
.webp
- HTML5 Video/Audio
- Setup compiling for Godot
- Download Ultralight
Your project structure should look like this before running with this extension.
demo/ # Godot project (Root)
addons/ # Addons
gdhtml/ # Godot-HTML extension
| bin/ # Extension libraries
| windows/ # Library platform
| x86_64/ # Platform arch
| gdhtml.*.dll # Extension library
| Ultralight.dll # Ultralight libraries
| UltralightCore.dll # ...
| WebCore.dll # ...
| AppCore.dll # ...
| inspector/ # Ultralight inspector
| resources/ # Ultralight resources
git submodule update --init --remote
cd godot-cpp
scons platform=<platform>
From the main folder.
scons platform=<platform>
JS interop is as simple as returning a Dictionary
from the virtual function _on_window_ready
. Then accessing it from JS using window.godot
.
Checkout the example script.
Important:
- JS Symbols are not currently supported. Convert them to a string before passing them to Godot.
Once you're ready to export your game/project make sure to:
Include html files in export via `Export Configuration`. | ![]() |
For auto imported resources, select `Keep File (No Import)`. | ![]() |