JLeb.Estragonia-Youf
2.0.0
dotnet add package JLeb.Estragonia-Youf --version 2.0.0
NuGet\Install-Package JLeb.Estragonia-Youf -Version 2.0.0
<PackageReference Include="JLeb.Estragonia-Youf" Version="2.0.0" />
<PackageVersion Include="JLeb.Estragonia-Youf" Version="2.0.0" />
<PackageReference Include="JLeb.Estragonia-Youf" />
paket add JLeb.Estragonia-Youf --version 2.0.0
#r "nuget: JLeb.Estragonia-Youf, 2.0.0"
#:package JLeb.Estragonia-Youf@2.0.0
#addin nuget:?package=JLeb.Estragonia-Youf&version=2.0.0
#tool nuget:?package=JLeb.Estragonia-Youf&version=2.0.0
Estragonia: Avalonia in Godot
Estragonia is a bridge allowing the use of the powerful Avalonia UI framework in the no less powerful Godot game engine!
It's GPU accelerated using Vulkan, which is the main renderer used in Godot 4.
Quick Start
- Have Godot 4.3.0 with .NET support installed.
- Install the
JLeb.EstragoniaNuGet package inside your Godot C# project. - Initialize the Avalonia application using
UseGodot()followed by eitherSetupWithoutStarting()(default, for embedded UI) orSetupWithGodot()(forShowDialog()support). See the step by step instructions for details. - Add a Godot
Controlnode to your scene, assign it a script inheriting fromJLeb.Estragonia.AvaloniaControland populate itsControlproperty with any valid Avalonia view.
For a more detailed guide, see the step by step instructions.
Resources
For various things to know regarding compatibility, rendering and input handling, see this document.
Samples:
- HelloWorld: a basic Avalonia-into-Godot setup.
- GameMenu: a functional game menu UI using the MVVM pattern, with controller support, UI animations and scaling.
NativeAOT Export (Experimental)
Estragonia supports NativeAOT compilation for Godot desktop exports, enabling fully native binaries without a managed runtime. This is experimental and requires manual configuration.
Prerequisites
- Godot 4.6+ with .NET support
- .NET 10 SDK (for
PublishAotsupport) - A project using Estragonia with the
Godot.NET.Sdk
Project Configuration
Add the following to your .csproj:
<PropertyGroup>
<PublishAot>true</PublishAot>
</PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="$(TargetName)" />
<TrimmerRootAssembly Include="JLeb.Estragonia" />
<TrimmerRootDescriptor Include="TrimmerRoots.xml" />
</ItemGroup>
Create a TrimmerRoots.xml file alongside your .csproj:
<linker>
<assembly fullname="YourProjectAssembly" preserve="all" />
<assembly fullname="JLeb.Estragonia" preserve="all" />
</linker>
Replace YourProjectAssembly with your project's assembly name (from [dotnet] project/assembly_name in project.godot).
Fix: PrivateAssets Conflict
If your .csproj contains an <ItemDefinitionGroup> that sets <PackageReference PrivateAssets="all" />, you must override this for assemblies that the ILC compiler needs. Add explicit PrivateAssets="none" overrides for GodotSharp and any directly-referenced Avalonia packages:
<ItemGroup>
<PackageReference Include="GodotSharp" Version="4.6.1" PrivateAssets="none" />
</ItemGroup>
<ItemDefinitionGroup>
<PackageReference PrivateAssets="all" />
</ItemDefinitionGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.*" PrivateAssets="none" />
<PackageReference Include="Avalonia.HarfBuzz" Version="12.*" PrivateAssets="none" />
</ItemGroup>
Without these overrides, PrivateAssets="all" prevents the assemblies from reaching the ILC compiler, causing Failed to load assembly 'GodotSharp' errors during publish.
Post-Export Step: Copy Native Libraries
Godot's desktop export places .NET outputs in a data_<project>_<platform>_<arch> subdirectory. However, NativeAOT-compiled code resolves native DLLs (like libSkiaSharp.dll, libHarfBuzzSharp.dll) relative to the host executable, not the subdirectory. After exporting, copy these files from the data_* folder to the executable's directory:
# Example: copy native SkiaSharp dependencies alongside the exported exe
Copy-Item "export_dir/data_MyProject_windows_x86_64/libSkiaSharp.dll" "export_dir/"
Copy-Item "export_dir/data_MyProject_windows_x86_64/libHarfBuzzSharp.dll" "export_dir/"
This step is required because Godot's export pipeline does not account for NativeAOT's DLL resolution behavior.
Known Limitations
- GodotSharp trim warnings:
GodotSharpis not annotated for trimming/AOT compatibility, so expectIL2104/IL3053warnings during publish. These are benign. - Binary size: With
preserve="all"on both the project and Estragonia assemblies, trimming is effectively disabled for those assemblies, resulting in larger output. - Desktop only tested: This configuration has been tested on Windows desktop exports. Other platforms may require additional adjustments.
License
The whole Estragonia project source code is under the MIT License.
Some specific licenses may apply to some assets used in the samples. See each sample for more information.
Video
https://github.com/MrJul/Estragonia/assets/1623034/7bcb12e4-0f0a-41c4-8dd8-71d8c80ede0b
From the GameMenu sample
| 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
- Avalonia (>= 12.0.2)
- Avalonia.HarfBuzz (>= 12.0.2)
- Avalonia.Skia (>= 12.0.2)
- GodotSharp (>= 4.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.