⚠️ ONLY TESTED ON WINDOWS ⚠️
This project doesn't include anything that is platform specific.
So there should be no issues.
If someone on x64 Linux/Mac could test, please let me know.
A GDExtension, using Ultralight, to render HTML.
- Godot 4.3+
- Ultralight 1.4.0 Beta
- 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 should look like this before building the plugin.
main_folder/
+--demo/ # game example/demo to test the extension
+--addons/ # addons
+--gdhtml/ # plugin folder
+--bin/ # plugin build folder / Other libraries
+--Ultralight.dll
+--UltralightCore.dll
+--WebCore.dll
+--AppCore.dll
+--resources/ # Ultralight resources folder (Copied from SDK folder)
+--inspector/ # Ultralight inspector folder (Copied from SDK folder)
+--godot-cpp/ # C++ bindings
+--src/ # Source code of the extension we are building
+--ultralight/ # Ultralight SDK
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_dom_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)`. |