This is a great project @BlizzCrafter thanks for continuing to support this! I’m working on a Level Editor for our game and it was extremely simple to plug in and get things up and running!
However, I’m having an issue I was hoping you could shed a light on. Most everything seems to be working fine, but for some reason I seem completely unable to load any Effect files. Is there a specific shader model that needs used or some special handling I missed somewhere? Whenever I attempt to load an effect file through the editor’s content manager it throws a SharpDX exception. Of course it’s the entirely useless “The parameter is incorrect” message so I’m not sure what the actual issue is, but it fails on loading instead of setting anything which I found interesting.
This has happened when trying to load the same shaders I use (and are working fine) in my game, and I’ve also tried to make an extremely simple shader to nail down the problem, but even as something as basic as the following still throws an exception:
My best guess is that there’s an issue somewhere because everything I have is building against MonoGame 3.7.1, but the only reference to MonoGame.Framework in my LevelEditor project is the included DLL from Forms. Is this possibly an issue from MGCB.exe being built against 3.7.1?
Also just to mention, Effects seem to be the only thing I’m having trouble with. Fonts, Models, etc all seem to be loading and working as expected.
Of course as soon as I posted my above question I found the issue. I needed to ensure the GraphicsProfile was set to HiDef instead of Reach. Feel free to ignore me!
Now importing the MonoGame.Content.Builder.targets and MonoGame.Common.props file and setting the MonoGamePlatform property in all MonoGame.Forms.target files (DX, GL).
Added MonoGame.Content.Builder content/libs/nuspecs/targets for DX and GL platform.
Added MonoGamePlatform property and importing MonoGame specific targets.
Correctly using the NativeLibs directory when including files.
Added MonoGame.Framework source code for the Windows platform to allow users to recompile it with custom modifications.
Updated post build events.
Register keystrokes immediately after setting AlwaysEnableKeyboardInput to true.
Always setting the KeyboardInput when the meta value changes.
Added additional NullReferenceException checks regarding the Editor service class.
It’s now possible to define custom clear options when using BeginAntialising, EndAntialising, BeginRenderTarget and EndRenderTarget (graphics.Clear(custom parameters)).
Changed the depth of the clear options to 1f as the default.
Hey! I’ve followed the instructions, and tried a few times to get this to work. However I keep getting a large error thrown when trying to add the object to a windows form. Any help?
Dropped the GL project, because there are already much faster available alternatives like this Gtk one.
All nugets besides the MonoGame.Forms.DX one got deprecated - still available on the market, but not reccomended anymore.
Removed the Content.Builder project, because it is not needed anymore - With MonoGame.Forms 3 it is and stays an all-in-one-solution, which also automatically contains content compilation the classical way via a .mgcb file and PipelineTool-Support. Simply remove it if you don’t need it!
Removed the customly compiled MonoGame.Framework library from the MonoGame.Forms project.
Changed:
Changed License from MIT to MS-PL to avoid mixed licenses in the project.
Setting the MonoGameContentReference property correctly, so that the compiled content gets copied to the output directory.
Better build configurations with updated nuget generation.
Added:
Added a new template project to the Visual Studio Marketplace which contains templates for Visual Studio 2017, 2019 & 2022!. I removed the old one (with 6700 downloads) from the market, because it was not possible to update it. Thanks for all your support!
– This template also contains item templates for the MonoGameControl and InvalidationControl now! This should boost your editor workflow by alot.
Added MonoGame.Framework.WindowsDX.9000 (created by @nkast) to the project which is faster, memory optimized, bugfixed and supports full mouse & keyboard input within WindowsForms. You can also update MonoGame.Forms to a new MonoGame version very easily from now on - just by updating the MonoGame.Framework.WindowsDX.9000 nuget package! It’s not neccessary anymore to do your own from-source-compilation-and-modification-experiments - just update and be happy Big thanks to nkast for doing and maintaining this!
ThriftyControl (based on InvalidationControl) item template with explanations.
Simple and easy project structure which combines both worlds: MonoGame and MonoGame.Forms. EDIT: There is a visual bug in this image at “MonoGamEditor”, but because of the awesome “E” in Editor, it’s not a bug … it’s a feature!!
Thank you very much for your attention; I hope you like this new update.
I’m not 100% sure, but I believe that there were simply some other priorities on the official MonoGame project.
I remember that some of the commits and PRs made by nkast simply got lost in time, because no one had time to take a deeper look into this.
I further believe that those commits were very specialized and maybe out of scope for the main project.
However, the WindowsDX.9000 project is in the end just exactly that - a collection of commits and PRs which originally got lost in time. And it turns out that this collection is worth gold for the MonoGame.Forms project. It’s exactly what this project needs.
The whole MonoGame Team and all contributors are doing a very awesome and excellent job in developing and maintaining the MonoGame project. Even side projects like WindowsDX.9000 are a proof of that fact in my opinion.
Hi, I am pretty new to MonoGame and have been trying to use MonoGame.Forms.
A problem that I ran into was that the MGCB editor would not open even when using the “Open With” option. No problem, I manually opened the editor and opened the file from there.
Now, say I add a file and have it copy to the Content folder, it does it and it works but VS doesn’t show the new files. In fact, I added a new folder using MGCB and VS didn’t make the changes (even after refreshing the solution explorer). The changes are there when viewing through the file explorer.
The real problem comes though when trying to build the content. If I build within the MGCB editor, literally nothing happens in the “Build Output” pane. Going over to the debug bin, no Content folder or .xnb files have been created either.
Note: if I manually build the content files in a normal MonoGame project and then copy the Content folder into the MonoGames.Forms debug bin, then it will actually work fine. I’m sure you can understand why that might be annoying though.
Is this a problem that has been solved already? What can I do or is that why the MonoGame.RuntimeBuilder exists?
Not sure if this will help you, but I created a project template for all my games, and when I use it I cannot open the MGCB from Visual Studio directly and some things break , I found a solution by copying a folder called “.config” which had a file called “dotnet-tools.json” which contains the following text:
After adding that file and folder to my folder project, the MGCB editor opened from within Visual Studio and compiled correctly. Can you try that? the folder has to be inside your game project folder