Skip to content

Commit

Permalink
demo添加exit按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed May 23, 2024
1 parent b8a66c0 commit de4701e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/scenes/main/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func _ready() -> void:
%CreateBtn.pressed.connect(_create_lobby_async)
%RefreshBtn.pressed.connect(_refresh_lobbies_list_async)
%JoinBtn.pressed.connect(_join_lobbies_async)
%ExitBtn.pressed.connect(get_tree().quit)

EOSP2P.set_relay_control(EOSP2P.RC_ForceRelays)

Expand Down
10 changes: 10 additions & 0 deletions demo/scenes/main/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ unique_name_in_owner = true
layout_mode = 2
text = "Join"

[node name="ExitBtn" type="Button" parent="CanvasLayer"]
unique_name_in_owner = true
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -8.0
offset_bottom = 8.0
grow_horizontal = 0
text = "exit"

[node name="Players" type="MultiplayerSpawner" parent="."]
unique_name_in_owner = true
_spawnable_scenes = PackedStringArray("res://scenes/main/player.tscn")
Expand Down

0 comments on commit de4701e

Please sign in to comment.