diff --git a/demos/gui/drag_and_drop/drag_and_drop.scn b/demos/gui/drag_and_drop/drag_and_drop.scn index f2122a459e8..94a25cc53e4 100644 Binary files a/demos/gui/drag_and_drop/drag_and_drop.scn and b/demos/gui/drag_and_drop/drag_and_drop.scn differ diff --git a/demos/gui/drag_and_drop/drag_drop_script.gd b/demos/gui/drag_and_drop/drag_drop_script.gd index a99b963efa3..21a737ce1aa 100644 --- a/demos/gui/drag_and_drop/drag_drop_script.gd +++ b/demos/gui/drag_and_drop/drag_drop_script.gd @@ -1,27 +1,24 @@ extends ColorPickerButton -# member variables here, example: -# var a=2 -# var b="textvar" + +#virtual function func get_drag_data(pos): - #use another control as drag preview + #use another colorpicker as drag preview var cpb = ColorPickerButton.new() cpb.set_color( get_color() ) cpb.set_size(Vector2(50,50)) set_drag_preview(cpb) #return color as drag data return get_color() - + +#virtual function func can_drop_data(pos, data): return typeof(data)==TYPE_COLOR - + +#virtual function func drop_data(pos, data): set_color(data) -func _ready(): - # Initialization here - pass -