Loading base.tscn +12 −2 Original line number Diff line number Diff line Loading @@ -2,13 +2,23 @@ [ext_resource type="Script" uid="uid://3kyt3shje5r1" path="res://scripts/window.gd" id="1_3vi8l"] [ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://icon.svg" id="1_rpg24"] [ext_resource type="PackedScene" uid="uid://c7nfcgjxqeg7l" path="res://dragon.tscn" id="2_8rhti"] [ext_resource type="PackedScene" uid="uid://c7nfcgjxqeg7l" path="res://dragon_popup.tscn" id="2_8rhti"] [node name="Base" type="Node2D"] [node name="Base" type="Node2D" node_paths=PackedStringArray("dragon_spots")] script = ExtResource("1_3vi8l") dragon_template = ExtResource("2_8rhti") dragon_spots = [NodePath("DragonSpot1"), NodePath("DragonSpot2"), NodePath("DragonSpot3")] [node name="Icon" type="Sprite2D" parent="."] position = Vector2(576, 324) scale = Vector2(9, 5.0625) texture = ExtResource("1_rpg24") [node name="DragonSpot1" type="Node2D" parent="."] position = Vector2(259, 450) [node name="DragonSpot2" type="Node2D" parent="."] position = Vector2(557, 239) [node name="DragonSpot3" type="Node2D" parent="."] position = Vector2(850, 360) dragon.tscn +4 −21 Original line number Diff line number Diff line [gd_scene load_steps=4 format=3 uid="uid://c7nfcgjxqeg7l"] [gd_scene load_steps=2 format=3 uid="uid://baa8gpicw2yg0"] [ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://icon.svg" id="1_ixu8j"] [ext_resource type="Script" uid="uid://bmlkcni4km614" path="res://scripts/dragon/dragon.gd" id="1_n6spy"] [ext_resource type="Script" uid="uid://ch7d3wo8ucskb" path="res://scripts/dragon/draggable.gd" id="2_qxdfn"] [node name="Dragon" type="Window"] disable_3d = true transparent_bg = true position = Vector2i(0, 36) size = Vector2i(128, 128) unresizable = true borderless = true transparent = true script = ExtResource("1_n6spy") [node name="Dragon" type="Node2D"] [node name="DragDropDetector" type="Control" parent="."] layout_mode = 3 anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("2_qxdfn") [node name="Icon" type="Sprite2D" parent="."] position = Vector2(64, 65) [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, 1) texture = ExtResource("1_ixu8j") dragon_popup.tscn 0 → 100644 +25 −0 Original line number Diff line number Diff line [gd_scene load_steps=4 format=3 uid="uid://c7nfcgjxqeg7l"] [ext_resource type="Script" uid="uid://bmlkcni4km614" path="res://scripts/dragon/dragon.gd" id="1_ctdir"] [ext_resource type="Script" uid="uid://ch7d3wo8ucskb" path="res://scripts/dragon/draggable.gd" id="2_2r6si"] [ext_resource type="PackedScene" uid="uid://baa8gpicw2yg0" path="res://dragon.tscn" id="3_ctdir"] [node name="DragonPopup" type="Window"] disable_3d = true transparent_bg = true position = Vector2i(0, 36) size = Vector2i(128, 128) unresizable = true borderless = true transparent = true script = ExtResource("1_ctdir") [node name="DragDropDetector" type="Control" parent="."] layout_mode = 3 anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("2_2r6si") [node name="Dragon" parent="." instance=ExtResource("3_ctdir")] position = Vector2(64, 64) scripts/dragon_instantiator.gd 0 → 100644 +27 −0 Original line number Diff line number Diff line class_name DragonInstantiator var _dragon_template: PackedScene var _positions: Array[Vector2i] = [] func _init(dragon: PackedScene, positions: Array[Node2D]) -> void: _dragon_template = dragon for pos in positions: _positions.push_back((Vector2i)(pos.position)) func instantiate() -> Node: var position: Vector2i = _positions[0] return _instantiate_dragon(position) func _instantiate_dragon(relative_position: Vector2i) -> Node: var dragon: Window = _dragon_template.instantiate() var window_position: Vector2i = DisplayServer.window_get_position() var window_size: Vector2i = DisplayServer.window_get_size() dragon.position = window_position + relative_position - dragon.size / 2 dragon.main_window_rect = Rect2i(window_position, window_size) dragon.show() return dragon scripts/dragon_instantiator.gd.uid 0 → 100644 +1 −0 Original line number Diff line number Diff line uid://bevot7ykr7hv2 Loading
base.tscn +12 −2 Original line number Diff line number Diff line Loading @@ -2,13 +2,23 @@ [ext_resource type="Script" uid="uid://3kyt3shje5r1" path="res://scripts/window.gd" id="1_3vi8l"] [ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://icon.svg" id="1_rpg24"] [ext_resource type="PackedScene" uid="uid://c7nfcgjxqeg7l" path="res://dragon.tscn" id="2_8rhti"] [ext_resource type="PackedScene" uid="uid://c7nfcgjxqeg7l" path="res://dragon_popup.tscn" id="2_8rhti"] [node name="Base" type="Node2D"] [node name="Base" type="Node2D" node_paths=PackedStringArray("dragon_spots")] script = ExtResource("1_3vi8l") dragon_template = ExtResource("2_8rhti") dragon_spots = [NodePath("DragonSpot1"), NodePath("DragonSpot2"), NodePath("DragonSpot3")] [node name="Icon" type="Sprite2D" parent="."] position = Vector2(576, 324) scale = Vector2(9, 5.0625) texture = ExtResource("1_rpg24") [node name="DragonSpot1" type="Node2D" parent="."] position = Vector2(259, 450) [node name="DragonSpot2" type="Node2D" parent="."] position = Vector2(557, 239) [node name="DragonSpot3" type="Node2D" parent="."] position = Vector2(850, 360)
dragon.tscn +4 −21 Original line number Diff line number Diff line [gd_scene load_steps=4 format=3 uid="uid://c7nfcgjxqeg7l"] [gd_scene load_steps=2 format=3 uid="uid://baa8gpicw2yg0"] [ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://icon.svg" id="1_ixu8j"] [ext_resource type="Script" uid="uid://bmlkcni4km614" path="res://scripts/dragon/dragon.gd" id="1_n6spy"] [ext_resource type="Script" uid="uid://ch7d3wo8ucskb" path="res://scripts/dragon/draggable.gd" id="2_qxdfn"] [node name="Dragon" type="Window"] disable_3d = true transparent_bg = true position = Vector2i(0, 36) size = Vector2i(128, 128) unresizable = true borderless = true transparent = true script = ExtResource("1_n6spy") [node name="Dragon" type="Node2D"] [node name="DragDropDetector" type="Control" parent="."] layout_mode = 3 anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("2_qxdfn") [node name="Icon" type="Sprite2D" parent="."] position = Vector2(64, 65) [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, 1) texture = ExtResource("1_ixu8j")
dragon_popup.tscn 0 → 100644 +25 −0 Original line number Diff line number Diff line [gd_scene load_steps=4 format=3 uid="uid://c7nfcgjxqeg7l"] [ext_resource type="Script" uid="uid://bmlkcni4km614" path="res://scripts/dragon/dragon.gd" id="1_ctdir"] [ext_resource type="Script" uid="uid://ch7d3wo8ucskb" path="res://scripts/dragon/draggable.gd" id="2_2r6si"] [ext_resource type="PackedScene" uid="uid://baa8gpicw2yg0" path="res://dragon.tscn" id="3_ctdir"] [node name="DragonPopup" type="Window"] disable_3d = true transparent_bg = true position = Vector2i(0, 36) size = Vector2i(128, 128) unresizable = true borderless = true transparent = true script = ExtResource("1_ctdir") [node name="DragDropDetector" type="Control" parent="."] layout_mode = 3 anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("2_2r6si") [node name="Dragon" parent="." instance=ExtResource("3_ctdir")] position = Vector2(64, 64)
scripts/dragon_instantiator.gd 0 → 100644 +27 −0 Original line number Diff line number Diff line class_name DragonInstantiator var _dragon_template: PackedScene var _positions: Array[Vector2i] = [] func _init(dragon: PackedScene, positions: Array[Node2D]) -> void: _dragon_template = dragon for pos in positions: _positions.push_back((Vector2i)(pos.position)) func instantiate() -> Node: var position: Vector2i = _positions[0] return _instantiate_dragon(position) func _instantiate_dragon(relative_position: Vector2i) -> Node: var dragon: Window = _dragon_template.instantiate() var window_position: Vector2i = DisplayServer.window_get_position() var window_size: Vector2i = DisplayServer.window_get_size() dragon.position = window_position + relative_position - dragon.size / 2 dragon.main_window_rect = Rect2i(window_position, window_size) dragon.show() return dragon
scripts/dragon_instantiator.gd.uid 0 → 100644 +1 −0 Original line number Diff line number Diff line uid://bevot7ykr7hv2