Example #1
0
            protected override void Layout()
            {
                base.Layout();

                _shield.X = X;
                _shield.Y = Y + (Height - _shield.Height) / 2;

                _position.X = Align(_shield.X + (_shield.Width - _position.Width) / 2);
                _position.Y = Align(_shield.Y + (_shield.Height - _position.Height) / 2 + 1);

                if (_flare != null)
                {
                    _flare.Point(_shield.Center());
                }

                _classIcon.X = Align(X + Width - _classIcon.Width);
                _classIcon.Y = _shield.Y;

                _desc.X        = _shield.X + _shield.Width + Gap;
                _desc.MaxWidth = (int)(_classIcon.X - _desc.X);
                _desc.Measure();
                _desc.Y = _position.Y + _position.BaseLine() - _desc.BaseLine();
            }
Example #2
0
        protected override void Layout()
        {
            ImIcon.X = 0;
            ImIcon.Y = 0;

            TfLabel.X        = PixelScene.Align(PixelScene.uiCamera, ImIcon.X + ImIcon.Width + Gap);
            TfLabel.MaxWidth = (int)(Width - TfLabel.X);
            TfLabel.Measure();
            TfLabel.Y = PixelScene.Align(PixelScene.uiCamera, ImIcon.Height > TfLabel.Height ? (ImIcon.Height - TfLabel.BaseLine()) / 2 : ImIcon.Y);

            _Height = Math.Max(ImIcon.Y + ImIcon.Height, TfLabel.Y + TfLabel.Height);
        }