public void OnDragStart(dfControl control, dfDragEventArgs dragEvent) { isDragging = true; dragEvent.Data = control.Color; dragEvent.State = dfDragDropState.Dragging; dragEvent.Use(); }
public void OnDragStart( dfControl control, dfDragEventArgs dragEvent ) { isDragging = true; dragEvent.Data = control.Color; dragEvent.State = dfDragDropState.Dragging; dragEvent.Use(); }
public void OnDragDrop( dfControl control, dfDragEventArgs dragEvent ) { var data = ( dragEvent.Data == null ) ? "(null)" : dragEvent.Data.ToString(); display( "DragDrop: " + data ); dragEvent.State = dfDragDropState.Dropped; dragEvent.Use(); }
public void OnDragStart(dfControl source, dfDragEventArgs args) { if (spec == null) return; args.Data = this; args.State = dfDragDropState.Dragging; args.Use(); DragCursor.Show(this, args.Position); }
public void OnDragDrop(dfControl control, dfDragEventArgs dragEvent) { if (dragEvent.Data is Color32) { control.Color = (Color32)dragEvent.Data; dragEvent.State = dfDragDropState.Dropped; dragEvent.Use(); } }
public void OnDragDrop( dfControl control, dfDragEventArgs dragEvent ) { if( dragEvent.Data is Color32 ) { control.Color = (Color32)dragEvent.Data; dragEvent.State = dfDragDropState.Dropped; dragEvent.Use(); } }
public void OnDragStart( dfControl control, dfDragEventArgs dragEvent ) { _label.Text = "Dragging..."; dragEvent.Data = this.name; dragEvent.State = dfDragDropState.Dragging; dragEvent.Use(); isDragging = true; }
void button_DragStart(dfControl control, dfDragEventArgs dragEvent) { dragEvent.Use(); BrainButton bb = control as BrainButton; draggedBrain = bb.Brain; dragEvent.State = dfDragDropState.Dragging; dragEvent.Data = this; Cursor.SetCursor(mouseCursor, Vector2.zero, CursorMode.Auto); // print("Drag start"); }
public void OnDragStart(dfControl source, dfDragEventArgs args) { if (this.Count > 0) { args.Data = this; args.State = dfDragDropState.Dragging; args.Use(); DnDExample_DragCursor.Show(this, args.Position); } }
public void OnDragStart( dfControl source, dfDragEventArgs args ) { if( this.Count > 0 ) { args.Data = this; args.State = dfDragDropState.Dragging; args.Use(); DnDExample_DragCursor.Show( this, args.Position ); } }
public void OnDragDrop(dfControl source, dfDragEventArgs args) { if (this.Count == 0 && args.Data is DndExample_InventoryItem) { var item = (DndExample_InventoryItem)args.Data; this.ItemName = item.ItemName; this.Icon = item.Icon; this.Count = item.Count; args.State = dfDragDropState.Dropped; args.Use(); } Refresh(); }
public void OnDragDrop(dfControl source, dfDragEventArgs args) { if (isEquipSlot && args.Data is DraggableSpecialization) { var item = (DraggableSpecialization)args.Data; spec = item.spec; this.name = item.spec.name; this.Icon = item.spec.icon; args.State = dfDragDropState.Dropped; args.Use(); espec.setEquiped(spec); } }
public void OnDragDrop( dfControl source, dfDragEventArgs args ) { if( this.Count == 0 && args.Data is DndExample_InventoryItem ) { var item = (DndExample_InventoryItem)args.Data; this.ItemName = item.ItemName; this.Icon = item.Icon; this.Count = item.Count; args.State = dfDragDropState.Dropped; args.Use(); } Refresh(); }
void OnDragStart(dfControl source, dfDragEventArgs args) { if (allowDrag(args)) { if (string.IsNullOrEmpty(Spell)) { // Indicates that the drag-and-drop operation cannot be performed args.State = dfDragDropState.Denied; } else { // Get the offset that will be used for the drag cursor var sprite = GetComponent <dfControl>().Find("Icon") as dfSprite; var ray = sprite.GetCamera().ScreenPointToRay(Input.mousePosition); var dragCursorOffset = Vector2.zero; if (!sprite.GetHitPosition(ray, out dragCursorOffset)) { return; } // Set the variables that will be used to render the drag cursor. // The UI library provides all of the drag and drop events necessary // but does not provide a default drag visualization and requires // that the application provide the visualization. We'll do that by // supplying a Texture2D that will be placed at the mouse location // in the OnGUI() method. ActionbarsDragCursor.Show(sprite, Input.mousePosition, dragCursorOffset); if (IsActionSlot) { // Visually indicate that they are *moving* the spell rather than // just dragging it into a slot sprite.SpriteName = ""; } // Indicate that the drag and drop operation can continue and set // the user-defined data that will be sent to potential drop targets args.State = dfDragDropState.Dragging; args.Data = this; } // Do not let the OnDragStart event "bubble up" to higher-level controls args.Use(); } }
void OnDragDrop(dfControl source, dfDragEventArgs args) { if (allowDrop(args)) { args.State = dfDragDropState.Dropped; var otherSlot = args.Data as SpellSlot; var temp = this.spellName; this.Spell = otherSlot.Spell; if (otherSlot.IsActionSlot) { otherSlot.Spell = temp; } } else { args.State = dfDragDropState.Denied; } args.Use(); }
void OnDragStart( dfControl source, dfDragEventArgs args ) { if( allowDrag( args ) ) { if( string.IsNullOrEmpty( Spell ) ) { // Indicates that the drag-and-drop operation cannot be performed args.State = dfDragDropState.Denied; } else { // Get the offset that will be used for the drag cursor var sprite = GetComponent<dfControl>().Find( "Icon" ) as dfSprite; var ray = sprite.GetCamera().ScreenPointToRay( Input.mousePosition ); var dragCursorOffset = Vector2.zero; if( !sprite.GetHitPosition( ray, out dragCursorOffset ) ) return; // Set the variables that will be used to render the drag cursor. // The UI library provides all of the drag and drop events necessary // but does not provide a default drag visualization and requires // that the application provide the visualization. We'll do that by // supplying a Texture2D that will be placed at the mouse location // in the OnGUI() method. ActionbarsDragCursor.Show( sprite, Input.mousePosition, dragCursorOffset ); if( IsActionSlot ) { // Visually indicate that they are *moving* the spell rather than // just dragging it into a slot sprite.SpriteName = ""; } // Indicate that the drag and drop operation can continue and set // the user-defined data that will be sent to potential drop targets args.State = dfDragDropState.Dragging; args.Data = this; } // Do not let the OnDragStart event "bubble up" to higher-level controls args.Use(); } }
void OnDragDrop( dfControl source, dfDragEventArgs args ) { if( allowDrop( args ) ) { args.State = dfDragDropState.Dropped; var otherSlot = args.Data as SpellSlot; var temp = this.spellName; this.Spell = otherSlot.Spell; if( otherSlot.IsActionSlot ) { otherSlot.Spell = temp; } } else { args.State = dfDragDropState.Denied; } args.Use(); }