FairyGUI.GGraph.ReplaceMe C# (CSharp) Method

ReplaceMe() public method

Replace this object to another object in the display list. 在显示列表中,将指定对象取代这个图形对象。这个图形对象相当于一个占位的用途。
public ReplaceMe ( GObject target ) : void
target GObject Target object.
return void
        public void ReplaceMe(GObject target)
        {
            if (parent == null)
                throw new Exception("parent not set");

            target.name = this.name;
            target.alpha = this.alpha;
            target.rotation = this.rotation;
            target.visible = this.visible;
            target.touchable = this.touchable;
            target.grayed = this.grayed;
            target.SetXY(this.x, this.y);
            target.SetSize(this.width, this.height);

            int index = parent.GetChildIndex(this);
            parent.AddChildAt(target, index);
            target.relations.CopyFrom(this.relations);

            parent.RemoveChild(this, true);
        }

Usage Example

 static public int ReplaceMe(IntPtr l)
 {
     try {
         FairyGUI.GGraph  self = (FairyGUI.GGraph)checkSelf(l);
         FairyGUI.GObject a1;
         checkType(l, 2, out a1);
         self.ReplaceMe(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.GGraph::ReplaceMe