.Net 8.0 webasssembly starter project using raylib-cs nuget.
I've followed DotnetRaylibWasm example project and some official Microsoft documentation.
Important
Please read the instructions below for building and publishing the project, as this may affect its functionality and cause unexpected errors.
You must have .Net 8.0 installed before start.
Then install wasm toolset:
dotnet workload install wasm-tools
Warning
Do not use Visual Studio publication, it may cause some strange errors!
Just call this command from the root directory of the solution:
dotnet publish -c Release
You could use whatever web-server you want to serve published files.
OR
You could also use dotnet serve
for this purpose:
If it's not installed, you need to install it with this command:
dotnet tool install --global dotnet-serve
And then just call this command to start web server for your build:
dotnet serve --mime .wasm=application/wasm --mime .js=text/javascript --mime .json=application/json --directory RaylibWasm\bin\Release\net8.0\browser-wasm\AppBundle\
While server is running you can use publish command to update your files without any need to restart server.
This project includes webassembly build of raylib native 5.5 (raylib.a
file), because it is not included with raylib-cs nuget.
Raylib-cs may still have some webassembly compatibility issues that have been mentioned here and here.
This project is not perfect, so I would welcome your suggestions and PR requests.
- to Ray and all raylib contributors for such a wonderful lib
- to ChrisDill for raylib C# bindings
- to stanoddly for dotnet webassembly example project