summaryrefslogtreecommitdiff
path: root/demos/gui/drag_and_drop/drag_drop_script.gd
blob: 21a737ce1aa0d19de9386a133f460ef7e55d0894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

extends ColorPickerButton


#virtual function
func get_drag_data(pos):
	
	#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)