FairyGUI.DragDropManager.StartDrag C# (CSharp) Method

StartDrag() public method

Start dragging. 开始拖动。
public StartDrag ( GObject source, string icon, object sourceData, int touchPointID = -1 ) : void
source GObject Source object. This is the object which initiated the dragging.
icon string Icon to be used as the dragging sign.
sourceData object Custom data. You can get it in the onDrop event data.
touchPointID int Copy the touchId from InputEvent to here, if has one.
return void
        public void StartDrag(GObject source, string icon, object sourceData, int touchPointID = -1)
        {
            if (_agent.parent != null)
                return;

            _sourceData = sourceData;
            _agent.url = icon;
            GRoot.inst.AddChild(_agent);
            _agent.xy = GRoot.inst.GlobalToLocal(Stage.inst.GetTouchPosition(touchPointID));
            _agent.StartDrag(touchPointID);
        }

Usage Example

Exemplo n.º 1
0
 static public int StartDrag(IntPtr l)
 {
     try {
         FairyGUI.DragDropManager self = (FairyGUI.DragDropManager)checkSelf(l);
         FairyGUI.GObject         a1;
         checkType(l, 2, out a1);
         System.String a2;
         checkType(l, 3, out a2);
         System.Object a3;
         checkType(l, 4, out a3);
         System.Int32 a4;
         checkType(l, 5, out a4);
         self.StartDrag(a1, a2, a3, a4);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }