Creating a Plugin Project
Last updated
Last updated
This tutorial provides instructions for creating a Glue plugin class project.
Before creating a plugin, be sure that you have downloaded the FlatRedBall and Gum repositories, and that you have successfully built and run the FlatRedBall Editor from source. For more information see the Building FlatRedBall From Source page.
Whether you create a new .sln depends on whether you plan on making a plugin that will be part of the main FlatRedBall repository. If your plugin is intended to be part of the FlatRedBall repository, please discuss your plans in Discord to make sure it will be accepted as a core library. If you are not sure if you want to include it in the main FRB repository, or if you intend this to be separate from the FRB repository, then you create your own .sln. Keep in mind that you do not need to create a new .sln for every plugin you are developing - it may be convenient to have multiple plugins in one .sln file. To create a new .sln file:
Open Visual Studio. If you are using a different IDE such as Rider, you will need to modiyf the steps.
Select the option to create a new project
Select Class Library and click Next
Enter a name and location for your new project and click Next
Select .NET 6.0 as the Framework - this is the current .NET version used in the FlatRedBall Editor as of January 2024, but it will likely change in the future. Click Create.
To link the necessary Glue libraries in your project:
Right-click on the Solution
Select Add -> Existing Project
Navigate to the folder where you have cloned the FlatRedBall Respository. For example, it may be at C:\Users\YourUserName\Documents\GitHub\FlatRedBall
Select the PluginLibraries.csprojj file located at <FlatRedBall Root>/FRBDK/Glue/PluginLibraries/PluginLibraries.csproj
Once this is added to your project, add the PluginLibraries as a dependency to your plugin project. You may notice that your project has a warning in the projects node in the Solution Explorer. To solve this problem, double-click your csproj and modify it:
Set the TargetFramework to net6.0-windows
Add the <UseWPF>true</UseWPF>
tag in teh same PropertyGroup.
For example, after the modifications your .csproj may look like the following csproj:
Now you have a project that is ready to go as a plugin project! Next we'll create our first plugin class.