Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
This page shows how to set up Gum to be used in a Maui app using SkiaSharp. This page assumes that you have a functional Maui app.
Open your Maui project in your preferred IDE
Add the Gum.SkiaSharp.Maui
NuGet package. Note that this also adds SkiaSharp to your project.
You can add SkiaGumCanvasView instances to any page or component. SkiaGumCanvasView is a view which inherits from SKCanvasView, but allows adding of Gum runtime elements. To add a SkiaGumCanvasView:
Open the .xaml file for an existing view or component
Add the following namespace to your page or view:
Add the following to a container, such as to a Grid. Note that the xaml specifies a Name because all Gum objects are added in C#:
Add the following in your C# (codebehind) for the given page or component:
You should now have a red circle on screen.
If you haven't already set up SkiaSharp for your project, add .UseSkiaSharp()
to your Builder. For more information see the SkiaSharp setup: