We have some exciting news to share with you all, recently I have managed to get MonoGame running inside the web browser. The web version of MonoGame requires WebGL 2 and has support for Chrome, Firefox, Opera and Vivaldi web browsers. You can see the good old Platformer2D XNA sample running on the following link: http://www.monogame.net/webdemo/ (source code also available)
Currently the web version is getting compiled to JS using Bridge.NET, this is however only a temporary solution and we’ll switch to using WebAssembly (WASM) once C# -> WASM conversion gets to a more stable point. This will greatly improve performance.
An Alpha version will become available on October 12th with easy to use templates, so keep your eyes peeled. If you are interested in following the news regarding this, you can do so in one of the following ways:
Looks great With the demo I experience a little input lag in Firefox, the character respond with a delay for key press and release but it runs smooth in Chrome
It’s very different actually! Blazor implements Mono in WebAssembly to run .NET assemblies directly while Bridge transpiles C# to JavaScript. Neither method is strictly better than the other, they’re just very different. As @harry-cpp mentioned the plan is to compile to WASM directly once that’s possible. That will be way faster than either method, but probably still very far away at this point.
So far the Blazor approach is probably the best way of implementing the WASM solution of Monogame. However, it immediately breaks on iOS 11. Still some time to wait until all the big guys stabilize it.
Whatever happened to XNA + Silverlight + Windows Phone?
Silverlight’s last Visual Studio is 2015 (2017 doesn’t support it by default and not sure about addons).
XNA has a Silverlight app option for Windows Phone, is there anyway to forget the app and make it run in a browser? Silverlight seems dead or dying and is probably best for XNA/MonoGame developers to avoid and is probably a nightmare for any past XNA users(?).
This seems like a working example, although I haven’t tried it, XNA on Silverlight for those interested:
As for the post’s solution(Web Demo), it doesn’t run on Windows 10’s or Windows 10 Mobiles’ Edge Browsers. Haven’t tried Internet Explorer…
Silvevrlight is a browser plugin, and browser plugins are dead.
As for not being able to run on Edge, its because its much easier to support WebGL 2 than 1 as it is way more feature complete. I can actually run stuff using WebGL 1 but render targets are way too much of a pain to implement them: