public static XnaHelpers

This is the primary class that is used to access basically everything that the XnaHelpersComponent updates.
public static members
public static ContentManager content //content manager
public static SpriteFont debugFont //a built in font for debugging purposes
public static Game game //a reference to the underlying game class that everything runs in
public static GameTime gameTime //a reference to the GameTime supplied by the game class
public static GraphicsDevice graphicsDevice //a reference to the GraphicsDevice
public static GraphicsDeviceManager //a reference to the graphics device manager
public static InputManager inputManager //the input manager used by InputHelper
public static string name //name of the game specified in the XnaHelpersComponent constructor
public static ResourceContentManager resxContent //used to get the spritefont embedded in the assembly, should not be used
public static SpriteBatch spriteBatch //a spritebatch that can be used for drawing
public static StandardAudio standardSoundManagers //contains a collection of sound managers 
public static WindowsStorage storage //contains ways of accessing storage on windows - compiled with #if WINDOWS
public static XboxStorage storage //contains ways of accessing storage on the xbox - compiled with #if XBOX
public static Texture2D whitePixel //a 1x1 texture2D that can be used to fill rectangles with a color
public static XactAudio xactSoundManagers //contains a collection of xact sound managers
There is an accessor for each of these. There are 2 functions in the class
public static void GetStorageDevice() //compiled with #if XBOX   - activates code to get the storage device
public static void SetStorageLocation() //compiled with #if WINDOWS - sets the storage location to the specified path
This class is the core of XnaHelpers, the XnaHelpersComponent updates virtually everything inside of this, You can use just this class for everything but it is easier and cleaner to use the other classes along with this one. E.G.

Its just as easy to use those classes alongside the XnaHelpers class as they reside in the same namespace.

Originally I had it all inside the XnaHelpers class but after using it for a bit it proved too messy and more annoying than useful, However if you prefer to use just the one class then by all means, there are accessors you can use, for example to get input from inside the XnaHelpers class you could call...
XnaHelpers.Input. input type

Last edited Jul 27, 2010 at 8:42 PM by Destroyer229, version 3


No comments yet.