Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communicating data between gdscript <-> browser #51

Open
3ddelano opened this issue Apr 20, 2024 · 8 comments
Open

Communicating data between gdscript <-> browser #51

3ddelano opened this issue Apr 20, 2024 · 8 comments

Comments

@3ddelano
Copy link

Is there a way I can send data from the browser side (javascript) to my gdscript and vice-versa?
For example: If a html textbox is typed into can i get the data typed in gdscript?

@Lecrapouille
Copy link
Owner

Hi @3ddelano the current way to interact with JS is given line

func _on_ColorPicker_color_changed(color):

But you cannot get feedback from JS. This is a request #40

@3ddelano
Copy link
Author

Oh thanks for the reply. Right now to get feedback from js im using a http server running in gdscript and the js makes API calls to the server. This works but needs a lot more code to setup.

@pimhakkert
Copy link
Collaborator

@3ddelano Using a HTTP server adds a lot of overhead as well. I'm working on a feature that will let you communicate easily between GDscript and the browser via a message protocol. You can use that to transfer JSON strings with instructions for each side as an example.

@3ddelano
Copy link
Author

Oh nice

@berkaycimsir
Copy link

@3ddelano Using a HTTP server adds a lot of overhead as well. I'm working on a feature that will let you communicate easily between GDscript and the browser via a message protocol. You can use that to transfer JSON strings with instructions for each side as an example.

Do you have any update on this ?

@Lecrapouille
Copy link
Owner

Lecrapouille commented Sep 4, 2024

@berkaycimsir for the moment no concerning @pimhakkert

@berkaycimsir
Copy link

@berkaycimsir for the moment no concerning @pimhakkert

Can you think of any shortcout way for this right now ?

I was able to send data from godot to my browser via MessageChannel but couldn't find a way to do it from browser to godot side.

@Lecrapouille
Copy link
Owner

@berkaycimsir can you go to my gdcef discord https://discord.gg/EckEwy7S5U to show me a simple example of what you have made ? I need a basic example since I'm not a webdev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants