mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-19 16:40:19 +02:00
DragDropUI added to world
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
script/source = "extends Container
|
||||
#DropZone
|
||||
|
||||
|
||||
#stuff can be dropped here
|
||||
func can_drop_data(_pos, data):
|
||||
return typeof(data) == typeof(PackedScene)
|
||||
@@ -12,7 +13,7 @@ func can_drop_data(_pos, data):
|
||||
func drop_data(_pos, data:PackedScene):
|
||||
var child = data.instance()
|
||||
child.position= _pos
|
||||
self.add_child(child)
|
||||
get_node(get_parent().ObjectParent).add_child(child)
|
||||
"
|
||||
|
||||
[node name="DragSink" type="Container"]
|
||||
|
||||
Reference in New Issue
Block a user