Synced Projects
Last updated
Was this helpful?
Last updated
Was this helpful?
Synced Projects provide a way to create and keep multiple projects in sync when working with multiple platforms. Typically the main project is a DesktopGL project, and synced projects would be for other platforms such as Android or Web.
A synced project is a completely separate .sln and .csproj which is initially created by the FlatRedBall Editor when the new Synced project is created.
Synced projects can be added to the same root folder as the main project. Therefore, a typical game might look like this:
MainProject (folder)
MainProject.sln
MainProject (folder containing original project like DesktopGL
MainProject.csproj (csproj for original project)
MainProjectWeb (folder for new synced project)
MainProjectWeb.sln
When a new synced project is created, FlatRedBall performs the following functionality automatically:
Generated and custom code files for screens and entities are automatically linked in the synced project
All content files are either linked in the synced project, or custom versions are created and linked. For example, when XNB files are built, these may differ per-platform. FlatRedBall takes care of this automatically
You are still responsible for managing your own code files if you add them through Visual Studio.
To open a project, click on the icon for the IDE for a given project. For example, the following icon can be used to open the TownRaiser XNA 4 Project:
New platforms can be added to an existing project at any point in development by adding a new synced project. To add a new synced project to an existing Glue project:
Open the Projects tab by selecting Project -> View Projects
Click the New Synced Project button
The New Project window appears. Select the desired platform such as Web (Browsers)
Enter a name for the project. Typically the name matches the original project's name with the platform appended. For example, MyProjectWeb.
Click the Create Project! button.
After creating the new synced project, it appears in the Projects tab.
Since FlatRedBall is designed to be syntactically identical across all platforms, most new synced projects compile and run with little or no modifications.
New Synced Projects are created using a standard FlatRedBall template for the given platform. In other words, a synced project references FlatRedBall for the given platform in the same way as a new project.
Synced projects can reference pre-built FlatRedBall .dlls (directly or using NuGet), or they can be linked to FlatRedBall source. The following screenshot shows a FlatRedBall Web project linking to the FlatRedBall Engine.
Synced projects automatically link all source files from the original project. This includes custom and generated code for screens, entities, and global content.
Content files are also linked by the synced project.
NuGet packages are not automatically synced across projects so if you have manually added a NuGet package to your main project, you may also need to add the same package or an alternative package to your synced projects.
Keep in mind that some NuGet packages are not available on all platforms. For example, NAudio does not work on non-windows platforms like Web. You may need to find alternative NuGet packages if one is not available on your target platform. Alternatively you can use conditional compilation symbols as explained in the page.