コード例 #1
0
        private void Init()
        {
            // Initial height. Should change as new entries are added.
            Height = InitialHeight;

            var titleBox = CreateChild("title-box", 0);
            {
                titleBox.Anchor   = AnchorType.TopStretch;
                titleBox.Pivot    = PivotType.Top;
                titleBox.RawWidth = -32f;
                titleBox.Height   = 32f;
                titleBox.Y        = -16f;

                iconSprite = titleBox.CreateChild <UguiSprite>("icon", 0);
                {
                    iconSprite.Anchor = AnchorType.LeftStretch;
                    iconSprite.Pivot  = PivotType.Left;
                    iconSprite.Width  = titleBox.Height;
                    iconSprite.X      = 0f;
                    iconSprite.SetOffsetVertical(0f);
                }
                titleLabel = titleBox.CreateChild <Label>("title", 1);
                {
                    titleLabel.Anchor    = AnchorType.Fill;
                    titleLabel.Offset    = new Offset(40f, 0f, 0f, 0f);
                    titleLabel.Alignment = TextAnchor.MiddleLeft;
                    titleLabel.WrapText  = true;
                    titleLabel.FontSize  = 20;
                    titleLabel.IsBold    = true;
                }
            }
            var line = CreateChild <UguiSprite>("line", 1);
            {
                line.Anchor     = AnchorType.BottomStretch;
                line.Pivot      = PivotType.Bottom;
                line.Y          = 0f;
                line.Height     = 21.5f;
                line.SpriteName = "glow-bar";
                line.ImageType  = Image.Type.Sliced;
                line.SetOffsetHorizontal(24);
            }
        }