GetChildIndex() public method

public GetChildIndex ( DisplayObject child ) : int
child DisplayObject
return int
Example #1
0
 static public int GetChildIndex(IntPtr l)
 {
     try {
         FairyGUI.Container     self = (FairyGUI.Container)checkSelf(l);
         FairyGUI.DisplayObject a1;
         checkType(l, 2, out a1);
         var ret = self.GetChildIndex(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #2
0
 static int GetChildIndex(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.Container     obj  = (FairyGUI.Container)ToLua.CheckObject <FairyGUI.Container>(L, 1);
         FairyGUI.DisplayObject arg0 = (FairyGUI.DisplayObject)ToLua.CheckObject <FairyGUI.DisplayObject>(L, 2);
         int o = obj.GetChildIndex(arg0);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #3
0
            public bool MoveNext()
            {
                if (_forward)
                {
                    if (_index >= _com._children.Count)
                    {
                        if (_com == _root)
                        {
                            _current = null;
                            return(false);
                        }

                        _current = _com;
                        _com     = _com.parent;
                        _index   = _com.GetChildIndex(_current) + 1;
                        return(true);
                    }
                    else
                    {
                        DisplayObject obj = _com._children[_index];
                        if (obj is Container)
                        {
                            _com   = (Container)obj;
                            _index = 0;
                            return(MoveNext());
                        }
                        _index++;
                        _current = obj;
                        return(true);
                    }
                }
                else
                {
                    if (_index < 0)
                    {
                        if (_com == _root)
                        {
                            _current = null;
                            return(false);
                        }

                        _current = _com;
                        _com     = _com.parent;
                        _index   = _com.GetChildIndex(_current) - 1;
                        return(true);
                    }
                    else
                    {
                        DisplayObject obj = _com._children[_index];
                        if (obj is Container)
                        {
                            _com   = (Container)obj;
                            _index = _com._children.Count - 1;
                            return(MoveNext());
                        }
                        _index--;
                        _current = obj;
                        return(true);
                    }
                }
            }