Skip to content

broknecho/gunjs-godot-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gunjs and Godot

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.


Demo

Godot Demo
Gun Hello World

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.


Project setup

These are the steps needed to get this working in the godot example project:

  1. Project -> Export
  2. Create a HTML 5 export configuration
  3. In the Head Include section, add this:
    <script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
  4. Check Experimental Virtual Keyboard for mobile support of the input
  5. Check Enabled under Progressive web app

Godot Project Notes

All code needed is in the GunTest.gd File. You can see the gdscript is almost 1:1 with the javascript hello world equivalent.

image

About

Hello World between Gunjs and Godot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published