Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: KeepInBoundsComponent

[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.

Methods

  • 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.

    • @p MinX is the left edge.
    • @p MinY is the top edge.
    • @p Width is the rectangle width.
    • @p 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.

    • @p MinX is the left edge.
    • @p MinY is the top edge.
    • @p Width is the rectangle width.
    • @p Height is the rectangle height.
    • @r this object
  • isHorizontal ()

    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.