コード例 #1
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            Vector2 tStrSize = new Vector2();

            foreach (var UII in uiItems)
            {
                if (UII.Visible)
                {
                    UII.Draw(spriteBatch, Position + tStrSize);
                }
                switch (uIAlignment)
                {
                case Toolbox.UIAlignment.Vertical:
                    switch (UII.UIIType)
                    {
                    case Toolbox.UIItemType.ImageText:
                        tStrSize += new Vector2(
                            0,
                            ToT.Fonts[UII.Font.ToString()].MeasureString(UII.DisplayText).Y + ToT.Textures[UII.ImageName].Height
                            );
                        break;

                    default:
                        tStrSize += new Vector2(
                            0,
                            ToT.Fonts[UII.Font.ToString()].MeasureString(UII.DisplayText).Y
                            );
                        break;
                    }
                    break;

                case Toolbox.UIAlignment.Horizontal:
                    switch (UII.UIIType)
                    {
                    case Toolbox.UIItemType.ImageText:
                        tStrSize += new Vector2(
                            ToT.Fonts[UII.Font.ToString()].MeasureString(UII.DisplayText).X + ToT.Textures[UII.ImageName].Width,
                            0
                            );
                        break;

                    default:
                        tStrSize += new Vector2(
                            ToT.Fonts[UII.Font.ToString()].MeasureString(UII.DisplayText).X,
                            0
                            );
                        break;
                    }
                    break;
                }
            }
        }