FSO.Client.UI.Controls.UIImage.With9Slice C# (CSharp) Method

With9Slice() public method

Sets 9 slice options on the image, this allows it to be cut into 9 pieces for scaling
public With9Slice ( int marginLeft, int marginRight, int marginTop, int marginBottom ) : UIImage
marginLeft int
marginRight int
marginTop int
marginBottom int
return UIImage
        public UIImage With9Slice(int marginLeft, int marginRight, int marginTop, int marginBottom)
        {
            NineSlice = true;
            NineSliceMargins = new NineSliceMargins {
                Left = marginLeft,
                Right = marginRight,
                Top = marginTop,
                Bottom = marginBottom
            };
            NineSliceMargins.CalculateOrigins(m_Texture);

            return this;
        }

Usage Example

Exemplo n.º 1
0
        public UIGameTitle()
        {
            Background = new UIImage(GetTexture((ulong)0x000001A700000002));
            Background.With9Slice(40, 40, 0, 0);
            this.AddAt(0, Background);
            Background.BlockInput();

            Label = new UILabel();
            Label.CaptionStyle = TextStyle.DefaultLabel.Clone();
            Label.CaptionStyle.Size = 11;
            Label.Alignment = TextAlignment.Middle;
            this.Add(Label);

            SetTitle("Not Blazing Falls");
        }