MonoGdx.Graphics.G2D.NinePatch.SetPadding C# (CSharp) Method

SetPadding() public method

public SetPadding ( int left, int right, int top, int bottom ) : void
left int
right int
top int
bottom int
return void
        public void SetPadding(int left, int right, int top, int bottom)
        {
            _padLeft = left;
            _padRight = right;
            _padTop = top;
            _padBottom = bottom;
        }

Usage Example

示例#1
0
        public NinePatch CreatePatch(string name)
        {
            foreach (AtlasRegion region in Regions)
            {
                if (region.Name == name)
                {
                    int[] splits = region.Splits;
                    if (splits == null)
                    {
                        throw new ArgumentException("Region does not have ninepatch splits: " + name);
                    }

                    NinePatch patch = new NinePatch(region, splits[0], splits[1], splits[2], splits[3]);
                    if (region.Pads != null)
                    {
                        patch.SetPadding(region.Pads[0], region.Pads[1], region.Pads[2], region.Pads[3]);
                    }

                    return(patch);
                }
            }

            return(null);
        }
All Usage Examples Of MonoGdx.Graphics.G2D.NinePatch::SetPadding