SkiaGum
Last updated
Last updated
The SkiaGum namespace contains classes which can be used to integrate SkiaSharp into your FlatRedBall game. This integration supports the following common scenarios:
Using Skia objects in your Gum screens. The Gum tool provides a plugin which enables Skia objects such as RoundedRectangle, ColoredCircle, and Svg.
Using SkiaSpriteCanvas to create FlatRedBall Sprites which can draw custom Skia graphics.
Using RenderableSkiaObject to create Gum objects which support custom Skia graphics.
As of April 2024, Skia is supported only in FlatRedBall MonoGame DesktopGL projects. You can verify that your project has the Skia libraries included by checking the linked assemblies as shown in the following screenshot:
Projects which link to source can optionally include the Skia libraries, as shown in the following screenshot:
If you are targeting a different platform (such as Android), please join the FlatRedBall Discord to discuss extending platform availability.
Note that Skia works on MonoGame DesktopGL, and with a little work it can work on mobile platforms, but it will not run on consoles without significant work. Practically speaking, Skia should not be used if your game will target consoles unless you are willing to make changes to Skia.
To add Skia controls to a Gum project:
Open your project in the FlatRedBall Editor
If your game wasn't created using the wizard, make sure you have added a Gum project
Open your Gum project by clicking the Gum icon at the top of FlatRedBall
Click Plugins -> Add Skia Standard Elements
You should now see the newly-added Skia elements under the Standard folder.
Once you have added Skia elements to your Screen you can use these elements in your Gum screens and components just like any other type of Gum object. For example, a ColoredCircle can be added to the MainMenuGum screen by drag+dropping the ColoredCircle standard into the workspace in Gum.
The ColoredCircle is also shown in your game, assuming the matching Screen is the startup screen.