namespace
Rect
Axis-aligned rectangles for HUD layout boxes, hitboxes, and camera regions. A Rect is four Q16.16 fixed components — position (x, y) (its top-left corner) and size (w, h) — packed into a single value that is copied by value and never allocates. It offers fast point-in-rect and rectangle-overlap tests. Every operation is deterministic fixed-point, bit-identical on every platform. Arguments are positional.
Rect.make(x, y, w, h) -> RectBuild a rectangle from a corner and a size.Rect.x(r) -> fixedThe left edge (x position).Rect.y(r) -> fixedThe top edge (y position).Rect.w(r) -> fixedThe width.Rect.h(r) -> fixedThe height.Rect.right(r) -> fixedThe right edge, x + w.Rect.bottom(r) -> fixedThe bottom edge, y + h.Rect.center(r) -> VectorThe center point as a Vector.Rect.contains(r, px, py) -> boolTrue when the point is inside.Rect.intersects(a, b) -> boolTrue when two rectangles overlap.