Exemplo n.º 1
0
        public CreditsMenu()
        {
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(
                @"Graphics\Pictures\Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 4f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.tint         = new Color(160, 160, 160, 255);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;

            // Credits
            CreditsText = new List <TextSprite>();
            Vector2 loc = Vector2.Zero;

            foreach (var credit in Constants.Credits.CREDITS)
            {
                if (!string.IsNullOrEmpty(credit.Role) || credit.Names.Any())
                {
                    // Role
                    var role = new TextSprite(
                        Config.UI_FONT, Global.Content, "Yellow",
                        loc,
                        credit.Role);

                    CreditsText.Add(role);
                    loc += new Vector2(0, role.CharHeight * Lines(credit.Role));

                    // Names
                    foreach (string name in credit.Names)
                    {
                        var nameText = new TextSprite(
                            Config.UI_FONT, Global.Content, "White",
                            loc + new Vector2(16, 0),
                            name);

                        CreditsText.Add(nameText);
                        loc += new Vector2(0, nameText.CharHeight * Lines(name));
                    }
                }

                loc += new Vector2(0, 16);
            }

            DataHeight = (int)loc.Y - 16;

            // Scrollbar
            if (this.MaxScroll > 0)
            {
                int height = Config.WINDOW_HEIGHT - (int)(BASE_OFFSET.Y * 2);
                Scrollbar     = new Scroll_Bar(height - 16, DataHeight, height, 0);
                Scrollbar.loc = new Vector2(Config.WINDOW_WIDTH - BASE_OFFSET.X, BASE_OFFSET.Y + 8);
            }

            // Full Credits Button
            if (!string.IsNullOrEmpty(Constants.Credits.FULL_CREDITS_LINK))
            {
                CreateFullCreditsButton();
            }
        }
        protected void initialize_scrollbar()
        {
            if (Scrollbar != null)
            {
                Scrollbar.UpArrowClicked   -= Scrollbar_UpArrowClicked;
                Scrollbar.DownArrowClicked -= Scrollbar_DownArrowClicked;
            }
            Scrollbar = null;

            if (this.total_rows > this.rows)
            {
                Scrollbar = new Scroll_Bar(
                    this.rows * 16 - 16, this.total_rows, this.rows, 0);
                int width = Window_Img == null ? this.Width : Window_Img.width;
                Scrollbar.loc               = new Vector2(width - 16, 16);
                Scrollbar.UpArrowClicked   += Scrollbar_UpArrowClicked;
                Scrollbar.DownArrowClicked += Scrollbar_DownArrowClicked;
                Scrollbar.scroll            = Scroll;
            }
        }
Exemplo n.º 3
0
        protected virtual void initialize_sprites()
        {
            // Window
            Window_Img        = new Prepartions_Item_Window(false);
            Window_Img.width  = this.Width;
            Window_Img.height = this.Height;

            refresh_nodes();

            Rows = (int)Math.Ceiling(ActorList.Count / (float)this.Columns);
            // Scrollbar
            if (Rows > this.VisibleRows)
            {
                Scrollbar     = new Scroll_Bar(this.VisibleRows * this.RowSize - 16, Rows, this.VisibleRows, 0);
                Scrollbar.loc = this.ScrollbarLoc;

                Scrollbar.UpArrowClicked   += Scrollbar_UpArrowClicked;
                Scrollbar.DownArrowClicked += Scrollbar_DownArrowClicked;
            }
            // Cursor
            Selected_Cursor      = new Hand_Cursor();
            Selected_Cursor.loc  = cursor_loc() + new Vector2(8, 4);
            Selected_Cursor.tint = new Color(192, 192, 192, 255);
        }