How to get all the ui nodes in a specific location?

Godot Version

4.7

Question

In a project i’m working on i made the ability to move the ui nodes by dragging them across the screen the thing is when there are two or more ui nodes on top of each other it start dragging the ones under it, is there a method that gives you a list of all the ui nodes in a given location?

You will have to track the overlapped nodes yourself, there isn’t a “get nodes at position” function and you have a different issue that wouldn’t be solved solely by such a function existing.

you’re right, i did this

func get_visible_windows_in_point(point: Vector2) → Array[Control]:
     var node_list: Array[Control] = []
     for node: Control in window_nodes:
          if node.get_global_rect().has_point(point) and node.visible:
               node_list.append(node)
return node_list

then to make sure the focused ui node receive input i use the move_to_front() method that is built in to all UI node