/// <summary> /// Draws a specific page /// </summary> /// <param name="pageName"></param> public void DrawPage(string pageName, SpriteBatch sb) { GUIPage page = GUIPages.Find(pg => pg.Identifier == pageName); if (page != null) { page.Draw(sb); } }
/// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="pageName"></param> /// <param name="identifier"></param> /// <returns></returns> public bool Hover(InputManager input, string pageName, string identifier) { GUIPage page = GUIPages.Find(pg => pg.Identifier == pageName); if (page != null) { return(page.Hover(input, identifier)); } throw new NullReferenceException( "Attempted to access a page that does not exist. You tried to access a page named " + "\"" + pageName + "\""); }
/// <summary> /// Hides a specific page /// </summary> /// <param name="pageName"></param> public void HidePage(string pageName) { GUIPage page = GUIPages.Find(pg => pg.Identifier == pageName); if (page != null) { page.HideAll(); } else { throw new NullReferenceException("Attempted to hide a page that does not exist. The " + "page you tried to access was named \"" + pageName + "\""); } }
/// <summary> /// Shows the specified component /// </summary> /// <param name="pageName"></param> /// <param name="identifier"></param> public void Show(string pageName, string identifier) { GUIPage page = GUIPages.Find(pg => pg.Identifier == pageName); // If the component is not null, show the component if (page != null) { page.Show(identifier); } else { throw new NullReferenceException( "Attempted to show a page that does not exist. You tried to access a page named " + "\"" + pageName + "\""); } }