FairyGUI.Margin.Parse C# (CSharp) Method

Parse() public method

public Parse ( string str ) : void
str string
return void
        public void Parse(string str)
        {
            if (str == null)
            {
                left = right = top = bottom = 0;
                return;
            }

            string[] arr = str.Split(',');
            if (arr.Length <= 1)
            {
                int k = int.Parse(arr[0]);
                top = k;
                bottom = k;
                left = k;
                right = k;
            }
            else
            {
                top = int.Parse(arr[0]);
                bottom = int.Parse(arr[1]);
                left = int.Parse(arr[2]);
                right = int.Parse(arr[3]);
            }
        }

Usage Example

示例#1
0
 static int Parse(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.Margin obj  = (FairyGUI.Margin)ToLua.CheckObject(L, 1, typeof(FairyGUI.Margin));
         string          arg0 = ToLua.CheckString(L, 2);
         obj.Parse(arg0);
         ToLua.SetBack(L, 1, obj);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
All Usage Examples Of FairyGUI.Margin::Parse
Margin