This project is a proof of concept to connect the Web release version of a Godot engine game and connect it to gunjs using the new JavascriptObject interface.
In the Gun Hello world, you need to change the line:
copy = gun.get('test').get('paste');
to
copy = gun.get('godot').get('paste');
Try editing the paste input box in the web browser and see it realtime update the godot example. In the Godot example, you need to put in text and then ENTER
or click the Send Text
button.
These are the steps needed to get this working in the godot example project:
- Project -> Export
- Create a HTML 5 export configuration
- In the
Head Include
section, add this:<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
- Check
Experimental Virtual Keyboard
for mobile support of the input - Check
Enabled
under Progressive web app
All code needed is in the GunTest.gd
File. You can see the gdscript is almost 1:1 with the javascript hello world equivalent.