GameServices

GameServices is a public static class that provides global access to commonly used game components, as well as other members and services that are useful, but tedious to implement wherever needed.

Container
GameServiceContainer is an XNA type that serves as a generic container for game services. Usage of this property is not necessary as GameServices has properties for specific services.

ScreenSize
The size in pixels of the game window, excluding the window's borders. Should be 800 by 480 pixels unless the window size is modified.

Graphics
The game's current GraphicsDevice, a type that handles the lower level of interaction with the graphics card. Typically used when creating new graphics objects.

SpriteBatch
The game's current SpriteBatch, a type that handles the drawing of all the game sprites in an efficient manner. To draw an object to the screen, simply call this member's Draw instance. There are several useful extension methods in the SpriteBatchExtensions class.

GameTime
The game's current GameTime, a type that provides a snapshot of game timing information, such as elapsed time and if the game is running slowly.

DebugFontSmall
A font (Consolas 6 point) that can be used to draw useful debugging information on the screen. This is better suited for uses where a lot of small text must be placed on screen. Use this as a parameter in the SpriteBatch.DrawString method.

DebugFontLarge
A font (Consolas 20 point) that can be used to draw useful debugging information on the screen. This is better suited for uses where only a few things need to be tracked, and large text would fit better. Use this as a parameter in the SpriteBatch.DrawString method.

InitializeServices
Initializes the services as listed by the parameters. Each parameter is a service instance. Called from SmlProgram, do not call again.

GetService
Gets a specific service by the type T.

AddService
Adds a service of type T that is the instance service specified by the parameter.

RemoveService
Removes a service of type T from the container.