FairyGUI.GList.AddChildAt C# (CSharp) Method

AddChildAt() public method

public AddChildAt ( GObject child, int index ) : GObject
child GObject
index int
return GObject
        public override GObject AddChildAt(GObject child, int index)
        {
            if (autoResizeItem)
            {
                if (_layout == ListLayoutType.SingleColumn)
                    child.width = this.viewWidth;
                else if (_layout == ListLayoutType.SingleRow)
                    child.height = this.viewHeight;
            }

            base.AddChildAt(child, index);
            if (child is GButton)
            {
                GButton button = (GButton)child;
                button.selected = false;
                button.changeStateOnClick = false;
            }

            child.onTouchBegin.Add(__itemTouchBegin);
            child.onClick.Add(__clickItem);

            return child;
        }

Usage Example

示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="caption"></param>
        /// <param name="index"></param>
        /// <param name="callback"></param>
        /// <returns></returns>
        public GButton AddItemAt(string caption, int index, EventCallback1 callback)
        {
            GButton item = CreateItem(caption, callback);

            _list.AddChildAt(item, index);

            return(item);
        }
All Usage Examples Of FairyGUI.GList::AddChildAt