Currently all development is being done on the NetStandard branch, so if you would like to build FlatRedBall Glue form source, we recommend pulling the NetStandard branch.
The FlatRedBall Game Engine and Tools are all open source:
FlatRedBall uses Gum UI including at runtime. This is also open source and can be found on Githhub:
Both repositories should be cloned to the same folder to make linking easier.
Downloading FlatRedBall Source
The easiest way to download and keep FlatRedBall source up to date is to use a Github client such as Github for Desktop. To download source using Github for Desktop:
- Install Github for Desktop
- Select File -> Clone Repository
- Select the URL tab
- Enter the FlatRedBall url: https://github.com/vchelaru/FlatRedBall. Keep the default folder as FlatRedBall
- Click the Clone button
- Switch to the appropriate branch. The default branch is NetStandard
After FlatRedBall is cloned, you will have a local copy on your machine.
Downloading Gum Source
You will also need to download Gum source, as FlatRedBall games which link against source also reference Gum files.
To do this (assuming Github for Desktop):
- Select File -> Clone Repository
- Select the URL tab
- Enter the Gum source: https://github.com/vchelaru/Gum . Keeping the default folder is recommended, but if not, be sure to use the same root as the FlatRedBall clone above.
Adding FlatRedBall Source to a Game Project using the FRB Editor
To add the FRB source to your project:
- Open your project in the FlatRedBall Editor
- Select the Project -> Link Game to FRB Source menu item
- The Add FRB Source tab appears, showing a text box for FlatRedBAll and Gum root folders. If your current project is also a Git project which is cloned to the same folder as FlatRedBall and Gum, then the FRB Editor attempts to fill in the file paths.
- If your paths are blank or incorrect, use the … button to select the file paths for each repository.
- If you are planning to use Gum Skia, check the option
- Click Link to Source
- After your project is linked, the Add FRB Source tab will disappear
Your game project should not directly reference the FlatRedBall Source.
Adding FlatRedBall Source to a Game Project Manually
If you would like to use the engine source in your game project:
- Open your game project in Visual Studio
- Expand the game project in the solution explorer
- Expand the References item
- Find the FlatRedBall entry. This is the reference to the prebuilt-dll
- Press the Delete key to remove this reference
- Right-click on the solution
- Select Add -> Existing Project…
- Navigate to the location of the FlatRedBall .csproj file for your given platform. For example, for PC, add <FlatRedBall Root>\Engines\FlatRedBallXNA\FlatRedBall\FlatRedBallDesktopGL.csproj
- Click Open to add the project to your game’s solution
- Right-click on your game’s References item and select Add Reference…
- Click the “Projects” category
- Check the FlatRedBallDesktopGL project (or whichever FlatRedBall project used for the given platform)
- Click OK
- Build and run your project
Building Glue
Prequisites
Verify that you have .NET 6 SDK installed
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.309-windows-x64-installer
The Glue solutions (.sln files) reference the FlatRedBall engine, so you do not have to open the FlatRedBall engine .sln files first. To build Glue, follow these steps:
- Download the FlatRedBall repository (either clone it or download the .zip file from Github)
- Download the Gum repository. Make sure to download it to the same folder where you downloaded the FlatRedBall repository, and name the folder Gum. See below for an example.
- Open the file <FlatRedBall Root>\FRBDK\Glue\Glue with All.sln.
- Verify that your build configuration is Debug, x86
- Build the project
It’s important that Gum and FlatRedBall are checked out to the same folder. For example, you may have:
- c:/MyDocuments/FlatRedBall
- c:/MyDocuments/Gum
GlueWithGum.sln
The “GlueWithGum.sln” solution includes Glue and the Gum plugin. If you run Glue from Visual Studio, you must first “Build Solution” so that the Gum plugin gets built. Simply debugging (pressing F5) does not build the Gum plugin.
Troubleshooting
Microsoft.Windows.UI.Xaml.CSharp.targets was not found…
When opening the project, you may get a message which states:
The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.CSharp.targets
For information on how to solve this problem, see the following link:
http://www.c-sharpcorner.com/UploadFile/8a67c0/visual-studio-2015-feature-shared-project-part-2/