summaryrefslogtreecommitdiff
path: root/demos/gui
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2015-04-04 09:31:21 +0300
committerAnton Yabchinskiy <arn@bestmx.ru>2015-04-04 09:31:21 +0300
commit16746f157f83d666079ba3266acec13d35b84c3f (patch)
tree8c872d18ccdef90a15e72622cd0139e0e64801a6 /demos/gui
parent43713810deaadfec6a1656767cf5520073e58a06 (diff)
parent5d99e15e43d5a446b35d48e8a3b08a478f1998a9 (diff)
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'demos/gui')
-rw-r--r--demos/gui/drag_and_drop/drag_and_drop.scnbin0 -> 2594 bytes
-rw-r--r--demos/gui/drag_and_drop/drag_drop_script.gd24
-rw-r--r--demos/gui/drag_and_drop/engine.cfg4
3 files changed, 28 insertions, 0 deletions
diff --git a/demos/gui/drag_and_drop/drag_and_drop.scn b/demos/gui/drag_and_drop/drag_and_drop.scn
new file mode 100644
index 0000000000..94a25cc53e
--- /dev/null
+++ b/demos/gui/drag_and_drop/drag_and_drop.scn
Binary files differ
diff --git a/demos/gui/drag_and_drop/drag_drop_script.gd b/demos/gui/drag_and_drop/drag_drop_script.gd
new file mode 100644
index 0000000000..21a737ce1a
--- /dev/null
+++ b/demos/gui/drag_and_drop/drag_drop_script.gd
@@ -0,0 +1,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)
+
+
diff --git a/demos/gui/drag_and_drop/engine.cfg b/demos/gui/drag_and_drop/engine.cfg
new file mode 100644
index 0000000000..448939c61d
--- /dev/null
+++ b/demos/gui/drag_and_drop/engine.cfg
@@ -0,0 +1,4 @@
+[application]
+
+name="Drag &amp; Drop (GUI)"
+main_scene="res://drag_and_drop.scn"