SetPadding() public method

public SetPadding ( int left, int right, int top, int bottom ) : void
left int
right int
top int
bottom int
return void
Exemplo n.º 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);
        }
Exemplo n.º 2
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;
        }