Download Source Code
Features
- Input events
- Individual control transparency
- Controls can have multiple skins, representing different states (hover, pressed etc.)
- Skinnable at the GUI level through static calls, or at the control level
- GUI and input event system implemented as game components
- Custom mouse cursors
- Modal windows
- Check boxes
- Combo boxes
- Dialogs
- Display settings dialog
- Icons
- Images
- Image buttons
- Text buttons
- Labels
- Menus
- Context menus
- Message boxes
- Radio buttons
- Radio groups
- Vertical scrollbars
- Text boxes
- Windows
- Flexible system for control animations
- Possibly a settings file for customizing skins
- Possibly bring the GUI into 3D for cooler animations
- Context menus for any control, currently has to be done manually for each case
- More complete textbox, with text selection and copy/paste
- Horizontal scrollbars
The code is in a pretty stable state at the moment, but I'm sure there's hundreds of bugs to be found in there. Please feel free to contact me regarding any bugs, questions, or suggestions.
One know issue is that hideous amounts of temporary textures are created while resizing windows. I know the reason, but am waiting to find a graceful solution. Basically the GUI draws each control to it's own texture, allowing simple clipping and transparencies. While resizing windows, the control texture is recreated many times a second, sometimes using up all available texture memory. The simple fix in place at the moment, is that the garbage collector is called whenever this happens. Not pretty, but it doesn't crash. Everything goes back to normal when resizing ends.
This project uses code based on the Event Based Input System of the XNA5D library, and to a lesser extent the GUI components. The XNA5D library is by John Sedlak, and is available at jsedlak.org/Xna5D.
The library also uses the BitmapFont portion of XNAExtras for text rendering. To add new fonts to your projects, use the BMFontGen tool which part of the same project. XNAExtras is by Gary Kacmarcik, and is available at blogs.msdn.com/garykac/articles/749188.aspx.
Finally, although I drew the complete graphical skin, the message box icons are by Ken Saunders, and are available at mouserunner.com/Spheres_ColoCons1_Free_Icons.html.
Sometime soon I will post an overview of the system, and possibly a few quick tutorials on how to use it. It's pretty well documented, so this shouldn't pose too much of a problem for most of you.
In addition, I'll be releasing the source code of my first project to actually use the GUI, a tile map editor. It's already in a pretty usable state, but is very much a work in progress.
Oh yeah, and I need a name for the project. At the moment I'm just using WindowSystem for XNA, which is really just a description. Any ideas would be appreciated.