Basics
Guides
API Reference
Basics
Guides
API Reference
[13:14] static extends: object
Static helper for FXGL's Distances utility object (com.almasb.fxgl.core.math.Distances). Provides the rectangle- to-rectangle distance helper that FXGLMath also delegates to for AABB checks.
distance (double X1, double Y1, double W1, double H1, double X2, double Y2, double W2, double H2)
Returns the shortest distance between two axis-aligned rectangles. Returns 0.0 when they overlap.
X1 is the first rect's X.Y1 is the first rect's Y.W1 is the first rect's width.H1 is the first rect's height.X2 is the second rect's X.Y2 is the second rect's Y.W2 is the second rect's width.H2 is the second rect's height.A double.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.