Basics
Guides
API Reference
Basics
Guides
API Reference
[16:7] extends: Component
Wraps FXGL's KeepInBoundsComponent (com.almasb.fxgl.dsl.components.KeepInBoundsComponent). Constrains the entity inside a Rectangle2D bounds region; can be limited to X axis only, Y axis only, or both. Entities with physics enabled are not supported.
KeepInBoundsComponent (double MinX = 0.0, double MinY = 0.0, double Width = 0.0, double Height = 0.0)
Creates a new KeepInBoundsComponent over the given rectangle.
MinX is the left edge.MinY is the top edge.Width is the rectangle width.Height is the rectangle height.adopt (object Ajo)
Wraps an existing KeepInBoundsComponent AussomJavaObject.
getBounds ()
Returns the Rectangle2D bounds AJO.
setBounds (double MinX, double MinY, double Width, double Height)
Sets the bounds rectangle.
MinX is the left edge.MinY is the top edge.Width is the rectangle width.Height is the rectangle height.this objectisHorizontal ()
Returns whether X-axis clamping is enabled.
setHorizontal (bool V)
isVertical ()
Returns whether Y-axis clamping is enabled.
setVertical (bool V)
onlyHorizontally ()
Restricts clamping to the X axis only.
onlyVertically ()
Restricts clamping to the Y axis only.
bothAxes ()
Enables clamping on both axes.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.