box2_expand_by_point(b, x, y) | - | Expands the box to include the point. |
box2_contains_point(b, x, y) | boolean | Returns true if point is inside the box. |
box2_intersects_box(b, b2) | boolean | Returns true if boxes intersect. |
box2_copy(b, src) | - | Copies bounds from src. |
box2_clone(b) | Array | Returns copy [minX,minY,maxX,maxY]. |
box2_contains_box(b, b2) | boolean | Returns true if b fully contains b2. |
box2_equals(b, b2) | boolean | Strict equality on all components. |
box2_clamp_point(b, x, y, out?) | Vector2 | Clamps point to box boundaries. |
box2_distance_to_point(b, x, y) | number | Euclidean distance to the box (0 if inside). |
box2_expand_by_scalar(b, s) | - | Expands bounds by scalar in all directions. |
box2_expand_by_vector(b, v) | - | Expands bounds by vector [x,y] in both directions. |
box2_get_center(b, out?) | Vector2 | Returns center point. |
box2_get_size(b, out?) | Vector2 | Returns width/height. |
box2_get_parameter(b, p, out?) | Vector2 | Returns normalized coordinates within the box. |
box2_is_empty(b) | boolean | True if minX > maxX or minY > maxY. |
box2_make_empty(b) | - | Sets to empty ([inf,inf,-inf,-inf]). |
box2_intersect(b, b2) | Box2 | Sets b to overlap with b2 (or empty if none). |
box2_union(b, b2) | Box2 | Sets b to the union of both boxes. |
box2_translate(b, offset) | - | Moves box by offset. |
box2_set_from_center_and_size(b, center, size) | Box2 | Sets from center [x,y] and size [w,h]. |
box2_set_from_points(b, points) | Box2 | Sets to enclose array of points [x,y]. |