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 | ||||
-rw-r--r-- | demos/gui/drag_and_drop/engine.cfg | 1 | ||||
-rw-r--r-- | demos/gui/drag_and_drop/icon.png | bin | 0 -> 806 bytes |
4 files changed, 8 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) - - diff --git a/demos/gui/drag_and_drop/engine.cfg b/demos/gui/drag_and_drop/engine.cfg index 448939c61d..49b9b93512 100644 --- a/demos/gui/drag_and_drop/engine.cfg +++ b/demos/gui/drag_and_drop/engine.cfg @@ -2,3 +2,4 @@ name="Drag & Drop (GUI)" main_scene="res://drag_and_drop.scn" +icon="res://icon.png" diff --git a/demos/gui/drag_and_drop/icon.png b/demos/gui/drag_and_drop/icon.png Binary files differnew file mode 100644 index 0000000000..f900d8d4a3 --- /dev/null +++ b/demos/gui/drag_and_drop/icon.png |