Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: BoundingShape

[13:14] static extends: object

Helper for FXGL's BoundingShape sealed class hierarchy. Each factory returns a BoundingShape configured for a specific shape (circle, axis-aligned box, polygon, chain, 3D box). Use the result to add a HitBox to an Entity for collision detection or physics.

Methods

  • circle (double Radius)

    Creates a circular bounding shape.

    • @p Radius is the circle radius in pixels.
    • @r An AussomJavaObject wrapping a BoundingShape.
  • box (double Width, double Height)

    Creates an axis-aligned box bounding shape.

    • @p Width is the box width in pixels.
    • @p Height is the box height in pixels.
    • @r An AussomJavaObject wrapping a BoundingShape.
  • polygon (list Points)

    Creates a polygon bounding shape from a flat list of doubles in [x0, y0, x1, y1, ...] order.

    • @p Points is a list of doubles.
    • @r An AussomJavaObject wrapping a BoundingShape.
  • box3D (double Width, double Height, double Depth)

    Creates a 3D axis-aligned box bounding shape.

    • @p Width is the box width.
    • @p Height is the box height.
    • @p Depth is the box depth.
    • @r An AussomJavaObject wrapping a BoundingShape.
  • chain (list Points)

    Creates a chain bounding shape from a flat list of doubles in [x0, y0, x1, y1, ...] order. Chains are open polylines commonly used for static level geometry (ground, walls).

    • @p Points is a list of doubles.
    • @r An AussomJavaObject wrapping a BoundingShape.
  • getSize (object ShapeAjo)

    Returns the bounding shape's overall size as a javafx Dimension2D AJO. Use getWidth() / getHeight() on the returned AJO to read the extents.

    • @p ShapeAjo is a BoundingShape AJO (from one of the static factory methods above).
    • @r An AussomJavaObject around a javafx.geometry.Dimension2D.