How to embed a Godot game inside another native desktop app?

Hi, new to Godot so trying to figure out how to do this. We want to build a native desktop app (using something like Electron or SwiftUI etc) which will have certain features. We also want to embed inside this app a godot game. (The idea being users can switch between two tabs … the game and the app’s other features. Its for the academic market so we are trying to use a game to teach but its not easy to build the rest of the education app UI in godot … so we wanna use ReactJS or SwiftUI to build that).

Not sure if I explained this clearly. Anyways was wondering how to go about this. How do we export from Godot so we can include it inside another Windows or Mac Desktop app.

Ty for reading!

I have no idea about SwiftUI or other native frameworks, but I have some Electron experience:

If you use an Electron based app, which essentially is just a web browser, then you can use the Web Export of Godot. The Web Export is basically a HTML page that includes our game compiled to Javascript. For more details and also on how to tweak the Web Export to your needs to embed it into Electron, please refer to: Exporting for the Web — Godot Engine (stable) documentation in English

However, I would like to challenge your statement of “but its not easy to build the rest of the education app UI in godot” because Godot has a super flexible and extensible UI system that - with some theming applied - can also look like a native desktop app. I just put together something with Godot over the last two weeks:

2 Likes

This is amazing, and makes me wonder how difficult it would be to use Godot to rewrite some of the internal tooling I use at work.

Hey!

I used this framework for years and my Android Audio apps were built with it…

https://x.com/TeotiGraphix/status/1430176081613660176

LilDrumMachine Android audio app

My goal is to recreate that drum machine in Godot using the audio system and this extended UI framework. I agree, Godot is capable, maybe just need some more UI components and data abstractions for the UI.

Edit: I meant port the UI components/framework to Godot. I like the idea of not running UI in the browser and trying to get more performance.

1 Like

Godot is absolutely and emphatically not a substitute for React or SwiftUI. Godot’s UI tools are more approachable for beginners, due to the simplicity and constraints, but they are very tedious to work with as an advanced user. Godot also lacks the accessibility features you can get with other tools, like screen reader compatibility. The previous commenter is also mistaken to claim that Godot can be made to look like a native desktop app. This cannot be accomplished with Godot’s built-in tools, nor any addon that I’m aware of, not beyond simply using system theme colors on Win, OSX, and Android.

You would probably have an easier time using PixiJS, Three.js, or Babylon.js for the game portion instead of trying to embed one thing in the other.

Agreed on this, but this is a sore spot in all “game” dev. If you need accessibility, you have to use frameworks that are accessible for sure.

Accessibility has never been a priority it seems like, because it’s still an issue decades later, which is sad.

can be made to look like a native desktop app.

That wasn’t me correct, I was just saying adding more Application UI components. I know Godot isn’t accessible.

1 Like

And just an FYI, it’s in Github but…

Pardon me. To be clear, I was referring to the first reply in this thread, which wrote that “Godot has a super flexible and extensible UI system that - with some theming applied - can also look like a native desktop app”. I don’t agree with this.

1 Like