2015-03-22 15:52:47 +00:00
|
|
|
|
|
|
|
extends ColorPickerButton
|
|
|
|
|
2015-03-22 16:01:34 +00:00
|
|
|
|
2015-03-22 15:52:47 +00:00
|
|
|
func get_drag_data(pos):
|
2015-11-21 12:31:25 +00:00
|
|
|
# Use another colorpicker as drag preview
|
2015-03-22 15:52:47 +00:00
|
|
|
var cpb = ColorPickerButton.new()
|
2015-12-09 07:38:23 +00:00
|
|
|
cpb.set_color(get_color())
|
|
|
|
cpb.set_size(Vector2(50, 50))
|
2015-03-22 15:52:47 +00:00
|
|
|
set_drag_preview(cpb)
|
2015-11-21 12:31:25 +00:00
|
|
|
# Return color as drag data
|
2015-03-22 15:52:47 +00:00
|
|
|
return get_color()
|
2015-03-22 16:01:34 +00:00
|
|
|
|
2015-12-09 07:38:23 +00:00
|
|
|
|
2015-03-22 15:52:47 +00:00
|
|
|
func can_drop_data(pos, data):
|
2015-12-09 07:38:23 +00:00
|
|
|
return typeof(data) == TYPE_COLOR
|
|
|
|
|
2015-03-22 16:01:34 +00:00
|
|
|
|
2015-03-22 15:52:47 +00:00
|
|
|
func drop_data(pos, data):
|
|
|
|
set_color(data)
|