17 lines
397 B
GDScript3
17 lines
397 B
GDScript3
|
extends Button
|
||
|
|
||
|
@onready var button = $"."
|
||
|
@onready var ip_input: TextEdit = $"../IP"
|
||
|
@onready var port_input: TextEdit = $"../Port"
|
||
|
|
||
|
func _ready():
|
||
|
button.text = "Click me"
|
||
|
button.pressed.connect(self._button_pressed)
|
||
|
|
||
|
func _button_pressed():
|
||
|
var ip = ip_input.text
|
||
|
var port = port_input.text
|
||
|
print("Trying to connect to " + ip + ":" + port)
|
||
|
Networking.ConnectToServer(str(ip), int(port))
|
||
|
|