diff options
Diffstat (limited to 'demos/gui/drag_and_drop')
-rw-r--r-- | demos/gui/drag_and_drop/drag_and_drop.scn | bin | 2594 -> 2947 bytes | |||
-rw-r--r-- | demos/gui/drag_and_drop/drag_drop_script.gd | 18 |
2 files changed, 7 insertions, 11 deletions
diff --git a/demos/gui/drag_and_drop/drag_and_drop.scn b/demos/gui/drag_and_drop/drag_and_drop.scn Binary files differindex 94a25cc53e..9dec254ef7 100644 --- a/demos/gui/drag_and_drop/drag_and_drop.scn +++ b/demos/gui/drag_and_drop/drag_and_drop.scn diff --git a/demos/gui/drag_and_drop/drag_drop_script.gd b/demos/gui/drag_and_drop/drag_drop_script.gd index 21a737ce1a..719c42fe8f 100644 --- a/demos/gui/drag_and_drop/drag_drop_script.gd +++ b/demos/gui/drag_and_drop/drag_drop_script.gd @@ -2,23 +2,19 @@ extends ColorPickerButton -#virtual function func get_drag_data(pos): - - #use another colorpicker as drag preview + # Use another colorpicker as drag preview var cpb = ColorPickerButton.new() - cpb.set_color( get_color() ) - cpb.set_size(Vector2(50,50)) + cpb.set_color(get_color()) + cpb.set_size(Vector2(50, 50)) set_drag_preview(cpb) - #return color as drag data + # Return color as drag data return get_color() -#virtual function + func can_drop_data(pos, data): - return typeof(data)==TYPE_COLOR + return typeof(data) == TYPE_COLOR + -#virtual function func drop_data(pos, data): set_color(data) - - |