Simple Setup

By the end of this tutorial you will know how to add Neoforce to your project,

Steps
  1. Reference Neoforce
  2. Import Neoforce and Define Basic Neoforce Objects
  3. Run

Reference Neoforce

First things first, we need to reference neoforce into the project
  1. Open Visual Studio, Create/Or Open a new Windows Project
    1. Ctrl + Shift + N
    2. Windows Game(3.1)/Windows Game(4.0)
  2. Open the solution explorer
    1. Ctrl + W+ S
  3. Right click the references item under your project
  4. Click Add References...
  5. Browse
  6. Find the Neoforce binary's (C:\Program Files\Tom Shane\Neoforce Controls\Bin)
  7. Select TomShane.Neoforce.Controls.dll and click Ok

Import Neoforce and Define Basic Neoforce Objects

Before beginning this Step, please copy the Skins folder from the Neoforce directory into your Projects debug and release Content folder

Import Neoforce into your project

using TomShane.Neoforce.Controls;

Define Basic Objects

Put these with the graphics object
//Neoforce Manager
private Manager manager;

Change the Game Construct to start the Manager

//Show the cursor
IsMouseVisible = true;
// Create an instance of manager using Default skin. We set the fourth parameter to true,
// so the instance of manager is registered as an XNA game component and methods
// like Initialize(), Update() and Draw() are called automatically in the game loop.
// If you set this parameter to false, you have to call Manager.Initialize(), 
// Manager.Update() and Manager.Draw() manually in their respective overriden methods
// of the game class.
// If you use two-parameter constructor, Default skin is used and manager is registered.
manager = new Manager(this, graphics, "Default", true);  

Run

  1. Build and run your project
And you should see the Neoforce Cursor

Confused? Not quite sure if you did something wrong or not? use the discussion section and ask for some help

Last edited Oct 21, 2010 at 3:48 AM by grimston, version 2

Comments

No comments yet.