diff --git a/autoload/global/script/global.gd b/autoload/global/script/global.gd index 43c52f9..c169fc2 100644 --- a/autoload/global/script/global.gd +++ b/autoload/global/script/global.gd @@ -33,7 +33,8 @@ var now_game_data:Dictionary={ "difficulty":0, "gold":9999, "health":100, - "spirit":999 + "spirit":999, + "map":"map_01" } var now_game_flow:GameFlow func get_now_character_data(): diff --git a/class/map/map_class.gd b/class/map/map_class.gd index 414735d..773f704 100644 --- a/class/map/map_class.gd +++ b/class/map/map_class.gd @@ -1,23 +1,14 @@ -extends ScrollContainer +extends TextureRect -class_name Map +class_name MapIndex signal click(scene_id:String) -func _gui_input(event: InputEvent) -> void: - if event is InputEventMouseMotion and Input.is_action_pressed("mouse_left"): - var relative:Vector2=event.relative - scroll_horizontal-=relative.x - scroll_vertical-=relative.y - - - - pass + func _on_linyi_pressed() -> void: - click.emit("") pass # Replace with function body. diff --git a/json/map.json b/json/map.json index 7c0250c..dfc095e 100644 --- a/json/map.json +++ b/json/map.json @@ -2,6 +2,6 @@ "map_01": { "name":"测试地图01", - "tscn":"" + "index":[] } } diff --git a/project.godot b/project.godot index 379ebd6..5f149dc 100644 --- a/project.godot +++ b/project.godot @@ -38,3 +38,13 @@ mouse_left={ "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(272, 11),"global_position":Vector2(281, 57),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) ] } +mouse_up={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":8,"position":Vector2(286, 11),"global_position":Vector2(295, 57),"factor":1.0,"button_index":4,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} +mouse_down={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(300, 12),"global_position":Vector2(309, 58),"factor":1.0,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} diff --git a/scene/map.gd b/scene/map.gd index 845c3fb..06bdf9f 100644 --- a/scene/map.gd +++ b/scene/map.gd @@ -1,17 +1,89 @@ extends Control -@onready var date: Label = $HBoxContainer/TextureRect/TextureRect/date -@onready var time: Label = $HBoxContainer/TextureRect/TextureRect/time -@onready var weather: Label = $HBoxContainer/TextureRect/TextureRect/weather -@onready var pos: Label = $HBoxContainer/TextureRect/TextureRect/pos -@onready var map_add_pos: Panel = $HBoxContainer/map_add_pos - +@onready var date: Label = $TextureRect/date +@onready var time: Label = $TextureRect/time +@onready var weather: Label = $TextureRect/weather +@onready var pos: Label = $TextureRect/pos +@onready var h_box_container: HBoxContainer = $ScrollContainer/HBoxContainer +@onready var scroll_container: ScrollContainer = $ScrollContainer +@onready var map_0=$ScrollContainer/HBoxContainer/TabContainer/map_example +@onready var map_1=$ScrollContainer/HBoxContainer/TabContainer/TextureRect +@onready var map_2=$ScrollContainer/HBoxContainer/TabContainer/TextureRect2 +@onready var map_now:=$ScrollContainer/HBoxContainer/TabContainer/map_example +var scale_rag:float=1: + set(val): + if val>1.3 and val<1.5 and (scale_rag<1.3 or scale_rag>1.5): + var t=get_tree().create_tween() + t.tween_property(map_now,"modulate:a",0,0.1) + t.tween_callback(map_now.hide) + var t2=get_tree().create_tween() + map_1.modulate.a=0 + map_1.show() + map_now=map_1 + t2.tween_property(map_1,"modulate:a",1,0.1) + elif val<=1.3 and scale_rag>1.3: + var t=get_tree().create_tween() + t.tween_property(map_now,"modulate:a",0,0.1) + t.tween_callback(map_now.hide) + var t2=get_tree().create_tween() + map_0.modulate.a=0 + map_0.show() + map_now=map_0 + t2.tween_property(map_0,"modulate:a",1,0.1) + elif val>1.5 and scale_rag<1.5: + var t=get_tree().create_tween() + t.tween_property(map_now,"modulate:a",0,0.1) + t.tween_callback(map_now.hide) + var t2=get_tree().create_tween() + map_2.modulate.a=0 + map_2.show() + map_now=map_2 + t2.tween_property(map_2,"modulate:a",1,0.1) + resize_map(scale_rag,val,get_global_mouse_position(),init_size) + scale_rag=val + pass +@export var scale_limit:Vector2=Vector2(1,2) +func resize_map(before_rag:float,rag:float,mouse_pos:Vector2,init:Vector2): + var l=rag/before_rag + var now_pos=Vector2(scroll_container.scroll_horizontal,scroll_container.scroll_vertical)+mouse_pos + now_pos*=l + var result=now_pos-mouse_pos + h_box_container.custom_minimum_size=init*rag + scroll_container.set_deferred("scroll_horizontal", result.x) + scroll_container.set_deferred("scroll_vertical", result.y) + + + pass +var init_size:Vector2=Vector2(1920,1080) # Called when the node enters the scene tree for the first time. func _ready() -> void: + h_box_container.custom_minimum_size=init_size pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: pass + +var keep_tween:Tween +func _gui_input(event: InputEvent) -> void: + if event is InputEventMouseMotion and Input.is_action_pressed("mouse_left"): + var relative:Vector2=event.relative + scroll_container.scroll_horizontal-=relative.x + scroll_container.scroll_vertical-=relative.y + if Input.is_action_pressed("mouse_up"): + if keep_tween==null: + keep_tween=create_tween() + else: + keep_tween.stop() + keep_tween=create_tween() + keep_tween.tween_property(self,"scale_rag",clamp(scale_rag+0.2,scale_limit.x,scale_limit.y),0.1) + if Input.is_action_just_pressed("mouse_down"): + if keep_tween==null: + keep_tween=create_tween() + else: + keep_tween.stop() + keep_tween=create_tween() + keep_tween.tween_property(self,"scale_rag",clamp(scale_rag-0.2,scale_limit.x,scale_limit.y),0.1) + diff --git a/scene/map.tscn b/scene/map.tscn index 315b994..a0a7829 100644 --- a/scene/map.tscn +++ b/scene/map.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=5 format=3 uid="uid://ccsaeb8hm5lsu"] +[gd_scene load_steps=9 format=3 uid="uid://ccsaeb8hm5lsu"] [ext_resource type="Texture2D" uid="uid://bx2layh7wm6ft" path="res://res/ui/ui_021_map/tuceng309.png" id="1_e45qx"] [ext_resource type="Script" path="res://scene/map.gd" id="1_ifxi0"] +[ext_resource type="Script" path="res://scene/map_scroll.gd" id="2_lmnx3"] [ext_resource type="Texture2D" uid="uid://bc4vkd7u4s4sb" path="res://res/ui/ui_021_map/tuceng308.png" id="2_slael"] [ext_resource type="Texture2D" uid="uid://bo84mljdw3my8" path="res://res/ui/ui_021_map/tuceng315.png" id="3_4y8t4"] +[ext_resource type="PackedScene" uid="uid://dtbfpnr54ifod" path="res://test/scene/map_example0.tscn" id="5_jn1dj"] +[ext_resource type="PackedScene" uid="uid://cscvsnrim8xwk" path="res://test/scene/map_example1.tscn" id="6_a88yc"] +[ext_resource type="PackedScene" uid="uid://db3m13gci7afs" path="res://test/scene/map_example2.tscn" id="7_bvfra"] [node name="map" type="Control"] layout_mode = 3 @@ -14,33 +18,72 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_ifxi0") -[node name="HBoxContainer" type="HBoxContainer" parent="."] +[node name="ScrollContainer" type="ScrollContainer" parent="."] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +mouse_filter = 2 +horizontal_scroll_mode = 3 +vertical_scroll_mode = 3 +script = ExtResource("2_lmnx3") -[node name="TextureRect" type="TextureRect" parent="HBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer"] +custom_minimum_size = Vector2(1920, 1080) +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme_override_constants/separation = 0 + +[node name="TextureRect" type="TextureRect" parent="ScrollContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 0 texture = ExtResource("1_e45qx") expand_mode = 3 -[node name="TextureRect" type="TextureRect" parent="HBoxContainer/TextureRect"] +[node name="TextureRect2" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_slael") +expand_mode = 3 + +[node name="TabContainer" type="MarginContainer" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="map_example" parent="ScrollContainer/HBoxContainer/TabContainer" instance=ExtResource("5_jn1dj")] +layout_mode = 2 + +[node name="TextureRect" parent="ScrollContainer/HBoxContainer/TabContainer" instance=ExtResource("6_a88yc")] +visible = false +layout_mode = 2 + +[node name="TextureRect2" parent="ScrollContainer/HBoxContainer/TabContainer" instance=ExtResource("7_bvfra")] +visible = false +layout_mode = 2 + +[node name="TextureRect4" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 8 +texture = ExtResource("2_slael") +expand_mode = 3 + +[node name="TextureRect3" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("1_e45qx") +expand_mode = 3 + +[node name="TextureRect" type="TextureRect" parent="."] z_index = 1 layout_mode = 1 -anchors_preset = 1 -anchor_left = 1.0 -anchor_right = 1.0 -offset_left = 3.94254 -offset_right = 515.943 +offset_right = 512.0 offset_bottom = 142.0 -grow_horizontal = 0 texture = ExtResource("3_4y8t4") -[node name="date" type="Label" parent="HBoxContainer/TextureRect/TextureRect"] +[node name="date" type="Label" parent="TextureRect"] layout_mode = 0 anchor_left = 0.347656 anchor_right = 1.0 @@ -52,7 +95,7 @@ text = "1999/12/12" vertical_alignment = 1 metadata/_edit_use_anchors_ = true -[node name="time" type="Label" parent="HBoxContainer/TextureRect/TextureRect"] +[node name="time" type="Label" parent="TextureRect"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.347656 @@ -66,7 +109,7 @@ text = "12:12" vertical_alignment = 1 metadata/_edit_use_anchors_ = true -[node name="Label3" type="Label" parent="HBoxContainer/TextureRect/TextureRect"] +[node name="Label3" type="Label" parent="TextureRect"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.59375 @@ -80,7 +123,7 @@ text = "天气:" vertical_alignment = 1 metadata/_edit_use_anchors_ = true -[node name="weather" type="Label" parent="HBoxContainer/TextureRect/TextureRect"] +[node name="weather" type="Label" parent="TextureRect"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.816406 @@ -94,7 +137,7 @@ text = "晴" vertical_alignment = 1 metadata/_edit_use_anchors_ = true -[node name="pos" type="Label" parent="HBoxContainer/TextureRect/TextureRect"] +[node name="pos" type="Label" parent="TextureRect"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.347656 @@ -108,24 +151,4 @@ text = "(000,000)" vertical_alignment = 1 metadata/_edit_use_anchors_ = true -[node name="TextureRect2" type="TextureRect" parent="HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 0 -texture = ExtResource("2_slael") -expand_mode = 3 - -[node name="map_add_pos" type="Panel" parent="HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="TextureRect4" type="TextureRect" parent="HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 8 -texture = ExtResource("2_slael") -expand_mode = 3 - -[node name="TextureRect3" type="TextureRect" parent="HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 0 -texture = ExtResource("1_e45qx") -expand_mode = 3 +[connection signal="gui_input" from="ScrollContainer" to="." method="_on_scroll_container_gui_input"] diff --git a/scene/mapA03A.tmp b/scene/mapA03A.tmp new file mode 100644 index 0000000..0c56cd0 --- /dev/null +++ b/scene/mapA03A.tmp @@ -0,0 +1,136 @@ +[gd_scene load_steps=6 format=3 uid="uid://ccsaeb8hm5lsu"] + +[ext_resource type="Texture2D" uid="uid://bx2layh7wm6ft" path="res://res/ui/ui_021_map/tuceng309.png" id="1_e45qx"] +[ext_resource type="Script" path="res://scene/map.gd" id="1_ifxi0"] +[ext_resource type="Texture2D" uid="uid://bc4vkd7u4s4sb" path="res://res/ui/ui_021_map/tuceng308.png" id="2_slael"] +[ext_resource type="Texture2D" uid="uid://bo84mljdw3my8" path="res://res/ui/ui_021_map/tuceng315.png" id="3_4y8t4"] +[ext_resource type="PackedScene" uid="uid://dtbfpnr54ifod" path="res://test/scene/map_example.tscn" id="5_jn1dj"] + +[node name="map" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_ifxi0") + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("1_e45qx") +expand_mode = 3 + +[node name="TextureRect" type="TextureRect" parent="ScrollContainer/HBoxContainer/TextureRect"] +z_index = 1 +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = 3.94254 +offset_right = 515.943 +offset_bottom = 142.0 +grow_horizontal = 0 +texture = ExtResource("3_4y8t4") + +[node name="date" type="Label" parent="ScrollContainer/HBoxContainer/TextureRect/TextureRect"] +layout_mode = 0 +anchor_left = 0.347656 +anchor_right = 1.0 +anchor_bottom = 0.373239 +offset_bottom = -4.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 38 +text = "1999/12/12" +vertical_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="time" type="Label" parent="ScrollContainer/HBoxContainer/TextureRect/TextureRect"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.347656 +anchor_top = 0.34507 +anchor_right = 0.556641 +anchor_bottom = 0.746479 +offset_bottom = -4.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 38 +text = "12:12" +vertical_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="Label3" type="Label" parent="ScrollContainer/HBoxContainer/TextureRect/TextureRect"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.59375 +anchor_top = 0.34507 +anchor_right = 0.816406 +anchor_bottom = 0.746479 +offset_bottom = -4.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 38 +text = "天气:" +vertical_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="weather" type="Label" parent="ScrollContainer/HBoxContainer/TextureRect/TextureRect"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.816406 +anchor_top = 0.34507 +anchor_right = 1.03906 +anchor_bottom = 0.746479 +offset_bottom = -4.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 38 +text = "晴" +vertical_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="pos" type="Label" parent="ScrollContainer/HBoxContainer/TextureRect/TextureRect"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.347656 +anchor_top = 0.661972 +anchor_right = 1.0 +anchor_bottom = 1.06338 +offset_bottom = -4.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 38 +text = "(000,000)" +vertical_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="TextureRect2" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_slael") +expand_mode = 3 + +[node name="map_example" parent="ScrollContainer/HBoxContainer" instance=ExtResource("5_jn1dj")] +layout_mode = 2 + +[node name="TextureRect4" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 8 +texture = ExtResource("2_slael") +expand_mode = 3 + +[node name="TextureRect3" type="TextureRect" parent="ScrollContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("1_e45qx") +expand_mode = 3 + +[connection signal="gui_input" from="ScrollContainer" to="." method="_on_scroll_container_gui_input"] diff --git a/scene/map_scroll.gd b/scene/map_scroll.gd new file mode 100644 index 0000000..8668c21 --- /dev/null +++ b/scene/map_scroll.gd @@ -0,0 +1,17 @@ +extends ScrollContainer + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + + +func _input(event: InputEvent) -> void: + + + pass diff --git a/test/map/map_01.png b/test/map/map_01.png new file mode 100644 index 0000000..b775705 Binary files /dev/null and b/test/map/map_01.png differ diff --git a/test/map/map_01.png.import b/test/map/map_01.png.import new file mode 100644 index 0000000..20e358d --- /dev/null +++ b/test/map/map_01.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c43yesnuqsk21" +path="res://.godot/imported/map_01.png-ba66dea318ebe09d0c7fcad58cf3bbcb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://test/map/map_01.png" +dest_files=["res://.godot/imported/map_01.png-ba66dea318ebe09d0c7fcad58cf3bbcb.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/test/map/map_02.png b/test/map/map_02.png new file mode 100644 index 0000000..9dde540 Binary files /dev/null and b/test/map/map_02.png differ diff --git a/test/map/map_02.png.import b/test/map/map_02.png.import new file mode 100644 index 0000000..0707f1e --- /dev/null +++ b/test/map/map_02.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dojjaa08033rm" +path="res://.godot/imported/map_02.png-da847203548d4544098afa3da799152a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://test/map/map_02.png" +dest_files=["res://.godot/imported/map_02.png-da847203548d4544098afa3da799152a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/test/map/map_03.png b/test/map/map_03.png new file mode 100644 index 0000000..08afeca Binary files /dev/null and b/test/map/map_03.png differ diff --git a/test/map/map_03.png.import b/test/map/map_03.png.import new file mode 100644 index 0000000..66975b9 --- /dev/null +++ b/test/map/map_03.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0rvcuxn1ybid" +path="res://.godot/imported/map_03.png-7e990fb8cd0abac378d2373bdc1ce3ab.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://test/map/map_03.png" +dest_files=["res://.godot/imported/map_03.png-7e990fb8cd0abac378d2373bdc1ce3ab.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/test/scene/map_example.tscn b/test/scene/map_example.tscn deleted file mode 100644 index 1fbbdbb..0000000 --- a/test/scene/map_example.tscn +++ /dev/null @@ -1,39 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://dtbfpnr54ifod"] - -[ext_resource type="Texture2D" uid="uid://dsphj1j6nr3j1" path="res://test/map/00004.webp" id="1_i44dx"] -[ext_resource type="Script" path="res://class/map/map_class.gd" id="1_iwfll"] - -[node name="map_example" type="ScrollContainer"] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -horizontal_scroll_mode = 3 -vertical_scroll_mode = 3 -script = ExtResource("1_iwfll") - -[node name="TextureRect" type="TextureRect" parent="."] -custom_minimum_size = Vector2(3840, 2160) -layout_mode = 2 -mouse_filter = 2 -texture = ExtResource("1_i44dx") - -[node name="linyi" type="Button" parent="TextureRect"] -layout_mode = 0 -anchor_left = 0.418229 -anchor_top = 0.588889 -anchor_right = 0.602083 -anchor_bottom = 0.706481 -metadata/_edit_use_anchors_ = true - -[node name="jining" type="Button" parent="TextureRect"] -layout_mode = 0 -anchor_left = 0.240625 -anchor_top = 0.531482 -anchor_right = 0.408854 -anchor_bottom = 0.667593 -metadata/_edit_use_anchors_ = true - -[connection signal="pressed" from="TextureRect/linyi" to="." method="_on_linyi_pressed"] -[connection signal="pressed" from="TextureRect/jining" to="." method="_on_jining_pressed"] diff --git a/test/scene/map_example0.tscn b/test/scene/map_example0.tscn new file mode 100644 index 0000000..1e5fea3 --- /dev/null +++ b/test/scene/map_example0.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=3 uid="uid://dtbfpnr54ifod"] + +[ext_resource type="Texture2D" uid="uid://c43yesnuqsk21" path="res://test/map/map_01.png" id="1_ihnyk"] +[ext_resource type="Script" path="res://class/map/map_class.gd" id="1_iwfll"] + +[node name="map_example" type="TextureRect"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("1_ihnyk") +expand_mode = 1 +script = ExtResource("1_iwfll") diff --git a/test/scene/map_example1.tscn b/test/scene/map_example1.tscn new file mode 100644 index 0000000..adeadad --- /dev/null +++ b/test/scene/map_example1.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=2 format=3 uid="uid://cscvsnrim8xwk"] + +[ext_resource type="Texture2D" uid="uid://dojjaa08033rm" path="res://test/map/map_02.png" id="1_fj1ma"] + +[node name="TextureRect" type="TextureRect"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("1_fj1ma") +expand_mode = 1 diff --git a/test/scene/map_example2.tscn b/test/scene/map_example2.tscn new file mode 100644 index 0000000..3678f2a --- /dev/null +++ b/test/scene/map_example2.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=2 format=3 uid="uid://db3m13gci7afs"] + +[ext_resource type="Texture2D" uid="uid://0rvcuxn1ybid" path="res://test/map/map_03.png" id="1_cnx2r"] + +[node name="TextureRect" type="TextureRect"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("1_cnx2r") +expand_mode = 1