This project is read-only.

Adding Xen to Your Game

Creating a New Project

Xen currently supports 4 different XNA platforms:
  • Windows
  • Windows Phone
  • Xbox 360
  • Silverlight (via SilverSprite)
  1. Create a new XNA 4.0/Silverlight 4 project with Visual Studio.
  2. For Silverlight, you will need to add the SilverArcade.SilverSprite and SilverArcade.SilverSprite.Core references to your project and add your game class to your XAML somewhat like this: (Visit the SilverSprite site for more info)
<UserControl x:Class="Demo_Viewport_Silverlight.MainPage"
    d:DesignHeight="800" d:DesignWidth="480"
    <Grid x:Name="LayoutRoot">
            <game:GameMain x:Name="game"/>
  1. And then follow the steps in the next section.

Adding Xen to an Existing Project

Xen allows you to interact with its features at various layers of its architecture as you see fit and/or need. For example, if you only need the Xen2D features to draw lines, you only need XenAspects and Xen2D. The following steps will allow you to use all of Xen's features.
  1. Add Reference to all of the .dll files included for your target platform (Windows, Phone, Xbox, Silverlight) folder in the Xen library you downloaded.
  2. Add the following namespaces to your game's .cs file:
using XenAspects;
using Xen2D;
using XenGameBase;
  1. Replace Microsoft.Xna.Framework.Game with GameBase. Example:
//public class Game1 : Microsoft.Xna.Framework.Game
public class Game1 : GameBase
  1. And you are now ready to use Xen!

TODO: this doc does not transition well into the primitives section.

Last edited Feb 9, 2011 at 6:41 PM by robzhu, version 4


No comments yet.