GUIManager class is responsible for Updating, Drawing and handling all GUIControls.

 

Usage

// define GUIManager in a higher scope (usually your Game class)
GUIManager guiManager;

// create GUIManager and load selected theme (usually in your LoadContent() method)
// pass Game class instance, location of themes and a current theme
guiManager = new GUIManager(this, "Themes", "Default");

// change theme
guiManager.LoadTheme("Themes", "DefaultGreen");

// load controls from XML file
guiManager.LoadControls("window.xml");

// save controls to XML file
guiManager.SaveControl("window.xml", myControl);

// ...

// update all controls (usually in your Update() method)
guiManager.Update(gameTime);

// draw all controls in specified SpriteBatch (usually in your Draw() method)
// don't forget to Begin() your SpriteBatch before calling this
guiManager.Draw(spriteBatch);

Last edited Apr 4, 2012 at 2:44 AM by qisur, version 2

Comments

No comments yet.