mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-12 21:42:23 +02:00
DragDropUI added to world
This commit is contained in:
@@ -1,25 +1,49 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://Menus/DragNDrop/DragSource.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Menus/DragNDrop/DragSink.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Objects/Banana/Banana.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://testSprites/bannane.png" type="Texture" id=4]
|
||||
[ext_resource path="res://testSprites/falle.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Objects/Traps/bear.tscn" type="PackedScene" id=6]
|
||||
|
||||
[sub_resource type="GDScript" id=1]
|
||||
script/source = "extends Control
|
||||
|
||||
export var ObjectParent:NodePath
|
||||
"
|
||||
|
||||
[node name="DragNDropUI" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -0.37735
|
||||
margin_right = -0.37735
|
||||
script = SubResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="DragSource" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 12.7532
|
||||
margin_top = 230.124
|
||||
margin_right = 44.7532
|
||||
margin_bottom = 262.124
|
||||
[node name="DragSourceBanana" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 13.5128
|
||||
margin_top = 238.668
|
||||
margin_right = 45.5128
|
||||
margin_bottom = 270.668
|
||||
texture = ExtResource( 4 )
|
||||
Item = ExtResource( 3 )
|
||||
PreviewIcon = ExtResource( 4 )
|
||||
|
||||
[node name="DragSourceFalle" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 45.5128
|
||||
margin_top = 238.668
|
||||
margin_right = 77.5128
|
||||
margin_bottom = 270.668
|
||||
texture = ExtResource( 5 )
|
||||
Item = ExtResource( 6 )
|
||||
PreviewIcon = ExtResource( 5 )
|
||||
|
||||
[node name="DragSink" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 1.19746
|
||||
margin_right = 1.19745
|
||||
anchor_right = 1.002
|
||||
anchor_bottom = 0.87
|
||||
margin_left = 1.0
|
||||
margin_right = 0.0399475
|
||||
margin_bottom = 0.0999756
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=19 format=2]
|
||||
[gd_scene load_steps=20 format=2]
|
||||
|
||||
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://World.gd" type="Script" id=2]
|
||||
@@ -18,6 +18,7 @@
|
||||
[ext_resource path="res://Objects/Slime/Slime.tscn" type="PackedScene" id=16]
|
||||
[ext_resource path="res://Boss/Boss_template.tscn" type="PackedScene" id=17]
|
||||
[ext_resource path="res://Boss/SlimeBoss/SlimeBoss.tscn" type="PackedScene" id=18]
|
||||
[ext_resource path="res://Menus/DragNDrop/DragNDropUI.tscn" type="PackedScene" id=19]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
@@ -125,6 +126,13 @@ FRICTION = 200
|
||||
[node name="Bonfire" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 448, 104 )
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="DragNDropUI" parent="CanvasLayer" instance=ExtResource( 19 )]
|
||||
margin_left = 0.0
|
||||
margin_right = 0.0
|
||||
ObjectParent = NodePath("../..")
|
||||
|
||||
[editable path="YSort/minion"]
|
||||
|
||||
[editable path="YSort/minion/Hurtbox"]
|
||||
|
||||
Reference in New Issue
Block a user