Any way of communication between Defold HTML5 game and my own JS?

Hi!

Is there any way to communicate between regular JS and the HTML5 game?
I need users to input a username and I can that “input screen” so much faster with CSS and HTML compared the method suggested here ( How to get text input from the user? (SOLVED) ).

The ideal case for me would be to some how put that info in a local storage file so that my Defold HTML5 game can somehow read what my regular JS put there.

For example: My JS puts the username in a file. The file is opened with sys.load() from Defold.

Does this sound reasonable/possible to do?

No, this is currently not possible. I know there’s been some discussions to add support for Lua to JS interaction, but I’m not sure if it will actually happen.

1 Like

So there is no way to send any kind of signal from JS to Defold’s Lua?
Basically I want Defold to load data from server via http request when user hits some button outside the app.

1 Like

Wihtout Lua-JS interop you can still make standard HTTP requests: http.request

Yeah, but I need to trigger this requests outside of the app :pensive:

1 Like

Working on a way here to communicate freely between Defold HTML5 games and their parent HTML page, but I won’t be able to finish a fully working example until a few days

1 Like