VisualBoundsHelper
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Static utility class for visual bounds detection and validation.
Source File: addons/grid_building/placement/placement_rules/helpers/visual_bounds_helper.gd
Extends: RefCounted
Public Methods
get_visual_bounding_box
Flags: static
Gets the global bounding box of all visual components in a node hierarchy. Returns Rect2 if visual components found, null if none.
node: Node - The root node to search for visual components
[returns]: Rect2 - Union of all visual bounding boxes, or null if no visual components found
has_visual_components
Flags: static
Checks if a node has any visual components in its hierarchy.
node: Node - The node to check
[returns]: bool - True if any visual components found, false otherwise
get_rect_corners
Flags: static
Gets the 4 corner points of a bounding rectangle.
rect: Rect2 - The rectangle to get corners from
[returns]: Array[Vector2] - Array of 4 corner points in order: top-left, top-right, bottom-left, bottom-right
is_point_over_valid_tile
Flags: static
Checks if a point is over a valid tile in a tilemap.
global_point: Vector2 - The global point to check
target_map: TileMapLayer - The tilemap to check against
[returns]: bool - True if the point is over a valid tile, false otherwise
get_out_of_bounds_corners
Flags: static
Gets all corners of a bounding box that are outside the tilemap bounds.
rect: Rect2 - The bounding box to check
target_map: TileMapLayer - The tilemap to check against
[returns]: Array[Vector2] - Array of corner points that are outside the tilemap bounds
Private Methods
_collect_visual_rects
Flags: static, private
Recursively collects bounding rectangles from visual components.
node: Node - The node to search
out_rects: Array[Rect2] - Output array to collect rectangles into
_get_sprite_global_rect
Flags: static, private
Computes the global bounding rect for a Sprite2D by transforming its local rect corners.
_get_polygon_global_rect
Flags: static, private
Computes the global bounding rect for a Polygon2D by transforming its polygon vertices.