Linking Games to FlatRedBall Engine Source
Last updated
Was this helpful?
Last updated
Was this helpful?
To add the FRB source to your project:
Make sure you have already cloned the FlatRedBall and Gum repositories. We recommend using Github for Desktop and cloning to the default location so that your game and FlatRedBall are sibling folder sin the same parent folder.
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. Select the root folder for where Gum and FRB repositories.
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 now directly reference the FlatRedBall Source.
The FlatRedBall Editor attempts to link FlatRedBall source regardless of the location of your projects relative to source. We strongly recommend keeping your project in the same directory (such as C drive) as FlatRedBall source. Otherwise, projects will be linked using absolute paths which makes your project far less portable. By using absolute paths others who clone your project must have the same exact folder structure as you do or the project will not build and run.
Furthermore, Github for Desktop always clones projects to the same directory: C:\YouserUerName\Owner\Documents\GitHub\YourProjectName
We recommend keeping these defaults for all repositories - your game and FlatRedBall. By using default locations others can clone the engine and game without needing ot make modifications to their defaults.
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 entries. This is the reference to the prebuilt-dll. Note that these may be direct references or NuGet packages depending on which version of FlatRedBall you are using, so be sure to check under both Assemblies and Packages. Press the Delete key on all references as mentioned below:
FlatRedBall DesktopGL:
FlatRedBallDesktopGLNet6
FlatRedBall.Forms.DesktopGlNet6
GumCore.DesktopGlNet6
SkiaInGum
StateInterpolation.DesktopNet6
FlatRedBall FNA:
FlatRedBall.FNA
FlatRedBall.Forms.FNA
GumCore.FNA
StateInterpolation.FNA
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 solutionComment
Right-click on your game's References item and select Add Reference...Comment
Click the "Projects" categoryComment
Check the FlatRedBallDesktopGL project (or whichever FlatRedBall project used for the given platform)Comment
Repeat the process for the other librariesComment
Click OK
Build and run your project