mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-07 00:10:09 +01:00
21 lines
359 B
GDScript
21 lines
359 B
GDScript
|
|
extends ColorPickerButton
|
|
|
|
|
|
func get_drag_data(pos):
|
|
# Use another colorpicker as drag preview
|
|
var cpb = ColorPickerButton.new()
|
|
cpb.color = color
|
|
cpb.rect_size = Vector2(50, 50)
|
|
set_drag_preview(cpb)
|
|
# Return color as drag data
|
|
return color
|
|
|
|
|
|
func can_drop_data(pos, data):
|
|
return typeof(data) == TYPE_COLOR
|
|
|
|
|
|
func drop_data(pos, data):
|
|
color=data
|