1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add example of using get_connection_list_from_node

This commit is contained in:
JekSun97
2025-06-28 03:19:22 +06:00
parent ebc36a7225
commit 8f51c22524

View File

@@ -223,6 +223,25 @@
keep_alive: bool
}
[/codeblock]
[b]Example:[/b] Get all connections on a specific port:
[codeblock]
func get_connection_list_from_port(node, port):
var connections = get_connection_list_from_node(node)
var result = []
for connection in connections:
var dict = {}
if connection["from_node"] == node and connection["from_port"] == port:
dict["node"] = connection["to_node"]
dict["port"] = connection["to_port"]
dict["type"] = "left"
result.push_back(dict)
elif connection["to_node"] == node and connection["to_port"] == port:
dict["node"] = connection["from_node"]
dict["port"] = connection["from_port"]
dict["type"] = "right"
result.push_back(dict)
return result
[/codeblock]
</description>
</method>
<method name="get_connections_intersecting_with_rect" qualifiers="const">