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

            float margin = (Height - InternalText.BaseLine()) / 2;

            InternalText.X = PixelScene.Align(PixelScene.uiCamera, X + margin);
            InternalText.Y = PixelScene.Align(PixelScene.uiCamera, Y + margin);

            InternalIcon.X = PixelScene.Align(PixelScene.uiCamera, X + Width - margin - InternalIcon.Width);
            InternalIcon.Y = PixelScene.Align(PixelScene.uiCamera, Y + (Height - InternalIcon.Height) / 2);
        }
Beispiel #2
0
        protected override void Layout()
        {
            base.Layout();

            if (_secondary.Text().Length > 0)
            {
                InternalText.Y = PixelScene.Align(Y + (Height - InternalText.Height - _secondary.BaseLine()) / 2);

                _secondary.X = PixelScene.Align(X + (Width - _secondary.Width) / 2);
                _secondary.Y = PixelScene.Align(InternalText.Y + InternalText.Height);
            }
            else
            {
                InternalText.Y = PixelScene.Align(Y + (Height - InternalText.BaseLine()) / 2);
            }
        }