githubEdit

Silk.NET

Introduction

This page assumes you have an existing Silk.NET project. This can be an empty project or an existing game.

Adding Gum NuGet package

The easiest way to add Gum to your project is to use the NuGet package. Open your project in your preferred IDE, or add Gum through the command line.

Add the Gum.SkiaSharp NuGet package (https://www.nuget.org/packages/Gum.SkiaSharparrow-up-right)

Modify csproj:

<PackageReference Include="Gum.SkiaSharp" />

Or add through command line:

dotnet add package Gum.SkiaSharp

Adding Source (Optional)

You can directly link your project to source instead of a NuGet package for improved debuggability, access to fixes and features before NuGet packages are published, or if you are interested in contributing.

To add source, first clone the Gum repository: https://github.com/vchelaru/Gumarrow-up-right

If you have already added the Gum NuGet package to your project, remove it.

Add the following projects to your solution:

  • <Gum Root>/SkiaGum/SkiaGum.csproj

  • <GumRoot>/GumCommon/GumCommon.csproj

Next, add SkiaGum as a project reference in your game project. Your project might look like this depending on the location of the Gum repository relative to your game project:

Initializing Gum

Gum requires SkiaSharp to render in Silk.NET. A full Silk.NET project requires a few hundred lines of code, so an entire Program file is not included here. The relevant code is included in the following block of code:

For a working project, see the Gum Silk.NET sample:

Gum running in a Silk.NET project

Last updated

Was this helpful?