Exemple #1
0
        /// <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);
            }
        }
Exemple #2
0
        /// <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 + "\"");
        }
Exemple #3
0
        /// <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 + "\"");
            }
        }
Exemple #4
0
        /// <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 + "\"");
            }
        }