Skip to content

ebshimizu/XNAUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XNAUtils

A library of classes meant to make life in XNA just a little easier.

Included Modules

  • ScreenManager - a simplified and annotated variant of the Microsoft Game State Management tutorial project
  • MenuScreen - Variant of the menu system found in the Microsoft Game State Management tutorial project
  • Sprite - Animated graphics using a sprite sheet
  • Configuration - Class to manage various XNA graphics and game settings
  • Particles - Simple force-based particle system
  • Camera - 2D camera class
  • UtilGame - Replaces the default Game class generated by XNA and sets up the game for use with ScreenManager, Configuration and Camera.
  • util_content - If using the above classes, make sure to import the files in this folder or replace the instances of these files with your own

Usage

This collection of utilities is distributed as source. To use, copy the desired parts over to your project and make sure to put the correct using statements in the files where you're using these utilities. Some of the classes use files in the util_content folder. You can replace these with your own instances, or use the ones provided in the util_content folder here.

The code is distributed as a XNA Game Class Library, but that project is mainly for code editing assistance. (You can create a library if you want, it does compile.)

Module Notes

ScreenManager and MenuScreen

Most of the documentation for this can be found in comments in the files themselves. I've added comments to the base project and rearranged things as needed to make things clearer. I have not needed to use all features of this, so parts of it aren't annotated as well.

Sprite

This class expects to be given a sprite sheet with no gaps, meaning that if you give it a texture that has room for 15 sprite frames (3 x 5) that each of those spaces are used. This might be a problem if you have a prime number of sprite frames, but you could write in some custom frame-limiting when those play back.

Configuration

Create the configuration object in the main game class, then fill in the desired settings, call configuration.apply and suddenly the settings are applied. It's like magic (but not really)

Particles

This component has a large number of tweakable parameters, so it's best to just consult the comments in source for it.

Camera

Manages transformation settings for a 2D camera. This can be used to manage screen resolutions, zoom in and out of screens, etc. It does not have a controller attached to it, so you'll have to write that yourself.

UtilGame

Replaces the default game object generated by XNA. Replace that object with this to set up the project for use with ScreenManager, Camera, and Configuration quickly.

About

A library of classes meant to make life in XNA just a little easier.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages