2dog.blazor
4.7.2.84
dotnet add package 2dog.blazor --version 4.7.2.84
NuGet\Install-Package 2dog.blazor -Version 4.7.2.84
<PackageReference Include="2dog.blazor" Version="4.7.2.84" />
<PackageVersion Include="2dog.blazor" Version="4.7.2.84" />
<PackageReference Include="2dog.blazor" />
paket add 2dog.blazor --version 4.7.2.84
#r "nuget: 2dog.blazor, 4.7.2.84"
#:package 2dog.blazor@4.7.2.84
#addin nuget:?package=2dog.blazor&version=4.7.2.84
#tool nuget:?package=2dog.blazor&version=4.7.2.84
2dog.blazor
Embed a Godot viewport in a Blazor WebAssembly page with 2dog.
GodotView owns a <canvas> and starts the Godot engine inside the .NET runtime
Blazor already booted: 2dog links the engine (libgodot.a) statically into the
client's dotnet.native.wasm, so Godot and your Razor components share one
runtime and one thread. Razor code calls Godot objects directly - there is no
JavaScript interop layer between them.
<GodotView Project="MyGame" PluginsInitializer="TwoDogWebBoot.PluginsInitializer()"
Started="OnStarted" style="width: 100%; height: 100vh;">
<div class="hud">@_fps fps</div>
</GodotView>
@code {
void OnStarted(twodog.Engine engine) => engine.Tree.Root.PrintTree();
}
The view needs the 2dog.engine and 2dog.browser-wasm packages in the Blazor
WebAssembly project; 2dog's Blazor host template wires everything up
(dnx 2dog add --blazor). See https://2dog.dev/hosts/blazor.
GodotView owns its Engine, and the engine owns the Godot instance. Quitting
uses Engine.RequestQuit(); browser teardown is asynchronous, with
Completion and Exited signaling its end. A restart creates a new Engine
only after completion.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.