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



// 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

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

// ...

// update all controls (usually in your Update() method)

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

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


No comments yet.