Пример #1
0
        protected override void CreateMesh()
        {
            // GUIMesh
            SetRectangleMesh(BorderWidth, ButtonColor, BorderColor);

            // TextMesh
            var x = PosX + OffsetX;
            var y = PosY + OffsetY;

            var maxW = GUIText.GetTextWidth(Text, FontMap);

            x = (int)System.Math.Round(x + (Width - maxW) / 2);

            var maxH = GUIText.GetTextHeight(Text, FontMap);

            y = (int)System.Math.Round(y + maxH + (Height - maxH) / 2);

            SetTextMesh(x, y);
        }