Click or drag to resize
DigitalRuneHow To: Add DigitalRune Graphics to a Project

This topic explains the steps necessary to add this library to a C# XNA game project in Visual Studio.

This topic contains the following sections:

Add references

Before types of this library can be used in a .NET project, references to the required assemblies must be added to the project. These are:

  • DigitalRune.dll
  • DigitalRune.Mathematics.dll
  • DigitalRune.Geometry.dll
  • DigitalRune.Animation.dll
  • DigitalRune.Graphics.dll

See Files, Folders and Dependencies to learn where these files are located.

To add an assembly reference in Visual Studio in a C# project, follow these steps:

  1. Open the Solution Explorer in Visual Studio.
  2. Right-click the project (or right-click the folder References within the project) and choose Add Reference...
  3. Select the tab Browse and find the folder containing the required assemblies.
  4. Select the required assembly and click OK.
Add DigitalRune Graphics content

DigitalRune Graphics includes pre-built assets (see Pre-Built Content) which are required for certain advanced features. To include the assets in the build process, add the DigitalRune Graphics content project to the solution:

  1. Right-click the solution and choose Add | Existing Project....
  2. Depending on the target platform select

    <DIGITALRUNE_FOLDER>\Content\XNA\Windows\DigitalRune.Graphics (Windows).contentproj

    or

    <DIGITALRUNE_FOLDER>\Content\XNA\Xbox360\DigitalRune.Graphics (Xbox 360).contentproj

    and click Open.

Then add a content reference to the main project:

  1. Open the Solution Explorer in Visual Studio.
  2. Right-click the project (or right-click the folder Content References within the project) and choose Add Content Reference...
  3. In the tab Projects select the DigitalRune Graphics content project and click OK.

Now, when the main project is built, the DigitalRune assets are automatically copied into the output folder.