GBSearchUtils

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Small helpers for node and scene tree searches used across tests and systems.

Source File: addons/grid_building/utils/gb_search_utils.gd

Public Methods

find_first

1
2
3
4
find_first(
    parent : Node,
    type
) -> Node

Flags: static

Finds the first node under the original parent that is of the passed class type.

parent: Node - The parent node to search within

type: Script/Class - The class type to search for


get_collision_object_2ds

1
get_collision_object_2ds(root : Node) -> Array[CollisionObject2D]

Flags: static

Gets all collision object 2ds from the root (inclusive) and all child objects. Performs recursive search to find all CollisionObject2D instances in the node tree.

root: Node - The root node to start searching from (inclusive)


get_collision_shapes_and_polygons_2d

1
get_collision_shapes_and_polygons_2d(root : Node) -> Array[Node2D]

Flags: static

Gets all collision shapes and collision polygons from the root (inclusive) and all child objects.

Performs recursive search to find all CollisionShape2D and CollisionPolygon2D instances in the node tree.

Returns Array[Node2D] because both CollisionShape2D and CollisionPolygon2D inherit from Node2D.

root: Node - The root node to start searching from (inclusive)


find_visual_node_direct

1
find_visual_node_direct(parent: Node) -> Node

Flags: static

Finds the first visual node (Sprite2D or AnimatedSprite2D) among the direct children of the given parent. Returns null if none found.


find_visual_node

1
2
3
4
find_visual_node(
    root: Node,
    recursive: bool = true
) -> Node

Flags: static

Finds a visual node (Sprite2D or AnimatedSprite2D) optionally searching recursively. By default, searches recursively to act as a universal helper.


is_visual_visible

1
2
3
4
is_visual_visible(
    root: Node,
    recursive: bool = true
) -> bool

Flags: static

Returns true if a visual node exists under root and is currently visible.