Embending Monogame into a form, willing to take a fork?

Hi,
We have made a lot of progress on embedding Monogame into an app and launching it in a form using a Webview. We are working through a host of crashes involving Monogame not cleaning itself up.

  1. has anyone successfully gotten Monogame to embed in a form using a content view before?
  2. If we successfully get Monogame to launch shut down is there interest in bringing our code into the main branch?

Thanks!

I believe what you’re looking for is MonoGame.Forms. I haven’t personally used it, but the author has been very good about updating it and addressing bugs. I recommend giving it a look!

1 Like

I’m curious as to why so many people want to integrate MonoGame into a form. MonoGame is essentially a form itself. It lacks default functionality, but boast more advanced features than a plain old form has.
If you add buttons, scroll bars input boxes etc. it has way more functionality than a form does. It is also cross platform when using OpenGL, so you technically get “Windows” forms on Mac, Linux and Windows, Android, PlayStation etc.

I’m just saying, what ever it is you are making, (I think MonoGame.Forms started as a Map Editor?), does not need a form component, and all you do is loose portability when doing so.

Do I have this wrong, and somehow you made Windows forms cross platform, or is there another reason I am just not seeing here?

Personally, I just want the CP integrated to MG for live loading as standard…

Adding to what you said, UWP adds XAML input capability too…

With the MonoGame.Forms library it’s possible to innovatively create your editor environment. For example by drag and dropping controls from the toolbox with the designer of Visual Studio. The MonoGameControl by itself is just a regular System.Windows.Forms.Control btw.

You can also use already existing user controls created by the WindowsForms community and drop them just in place, which makes it easy to design your editor.

Another thing is, that we de-encapsulated the MonoGame “game” class from the MonoGame.Forms library, so that it became possible to have more control over updating frames and adding additional MonoGameControls without hassle.

Finally we have implemented service classes containing helpers like a RenderTargetManger for example, which makes working with RenderTargets easier.

Take a look at the readme. We have some pictures there showing MonoGame.Forms running on Linux using mono. It’s not a fast implementation, but for simple editors it should be enough.

But yeah, if you want a performant cross platform editor we recommend using something like imgui together with a MonoGame.DesktopGL project. There are many imgui widgets available which also makes designing your editor pretty easy.

In the end there are many ways of creating your own editor (MonoGame.Framework.WpfInterop is also a thing) It depends on your technology knowledge and design goals. The MonoGame.Forms library is just one way of doing it as well as just using a regular MonoGame project and programmatically creating buttons etc. a way is.

I think what really matters is, that the MonoGame community have this kind of choice or rather as many ways as possible to reach their goals.

Just pick your cherry and start creating stuff! :slight_smile:

We need Xamrin.Forms not Windows.Forms. We want to embed it because it needs to run from a hub app.