Ejemplo n.º 1
0
        public static void Initialize()
        {
            #region menu setup
            menuLabel = new Text(P._Canvas);
            menuLabel.SetPos(128, 28);
            menuLabel.Font = P.GuiFontLarge;
            menuLabel.String = "Books";

            menu = new ListBox(P._Canvas);
            foreach (Book b in activeBooks)
            {
                activeBookItems.Add(menu.AddItem(b.title));
            }
            menu.EnableScroll(true, true);
            menu.SetSize(160, 2*P.ScreenSize.Y/3 - 36);
            menu.SetPos(128,48);

            menu.MouseInputEnabled = true;
            for (int i = 0; i < activeBookItems.Count; i++)
            {
                activeBookItems[i].OnRowSelected += new Base.ControlCallback(Book_OnRowSelected);
                activeBookItems[i].SetTextColor(System.Drawing.Color.Gray);
            }
            #endregion

            bookTitle = new Text(P._Canvas);
            bookTitle.String = "";
            bookTitle.SetPos(300, 40);
            bookTitle.Font = P.GuiFontLarge;

            authorText = new Text(P._Canvas);
            authorText.String = "";
            authorText.SetPos(300, 64);

            statusText = new Text(P._Canvas);
            statusText.SetPos(300, 80);
            statusText.String = "";

            publishingProgress = new ProgressBar(P._Canvas);
            publishingProgress.Value = 0;
            publishingProgress.SetBounds(300, P.ScreenSize.Y/3-16, 200, 16);
            publishingProgress.Hide();

            GameManager.BookPageItems.Add(menuLabel);
            GameManager.BookPageItems.Add(menu);
            GameManager.BookPageItems.Add(bookTitle);
            GameManager.BookPageItems.Add(authorText);
            GameManager.BookPageItems.Add(publishingProgress);
            GameManager.BookPageItems.Add(statusText);
        }