doceazedo / godot_wry

🌐 Cross-platform WebView extension for Godot 4
https://godotengine.org/asset-library/asset/3426
MIT License
50 stars 2 forks source link

Running webview in the editor (@tool) #4

Open lavstudia opened 3 weeks ago

lavstudia commented 3 weeks ago

You need to be able to run webview in the editor. Now this opportunity is sorely lacking. Judging by the code, webview is assigned to window. And if you just change:

...
#[derive(GodotClass)]
#[class(base=Control)]
...

to:

...
#[derive(GodotClass)]
#[class(tool, base=Control)]
...

then the result will be on top of the editor window, on top there will be a webview

Thank you!

doceazedo commented 3 weeks ago

Hey! I'm curious to know why you would need the webview in the editor 😄 I'm also wondering if this might cause unwanted behaviors such as blocking the view of the editor if not positioned right or preventing mouse clicks...

lavstudia commented 3 weeks ago

Hello! I understand, it may sound crazy)) For example, the godot plugin can display a webview from a smart home (or any other), with godot controls nearby. It will also be very convenient if a preview is available for the webview in the godot editor.

I think you are familiar with: https://github.com/Lecrapouille/gdcef

In gdcef, web browsing is available from the godot editor. But the gdcef approach itself is very cumbersome and unstable.

doceazedo commented 3 weeks ago

Got it! It might be a bit tricky to get the position right inside the editor, but I guess it's doable