Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: CellMoveComponent

[14:7] extends: Component

Wraps FXGL's CellMoveComponent (com.almasb.fxgl.pathfinding.CellMoveComponent), which moves an entity smoothly toward a target cell. Pair with AStarMoveComponent to drive an entity along an A* path.

Methods

  • CellMoveComponent (int CellWidth = 0, int CellHeight = 0, double Speed = 0.0)

    Creates a new CellMoveComponent.

    • @p CellWidth is the per-cell pixel width.
    • @p CellHeight is the per-cell pixel height.
    • @p Speed is the movement speed in pixels per second.
  • adopt (object Ajo)

    Wraps an existing CellMoveComponent AussomJavaObject.

  • isAtDestination ()

  • isMoving ()

  • isMovingUp ()

  • isMovingDown ()

  • isMovingLeft ()

  • isMovingRight ()

  • getCellWidth ()

  • setCellWidth (int W)

  • getCellHeight ()

  • setCellHeight (int H)

  • getSpeed ()

  • setSpeed (double S)

  • getCellX ()

  • getCellY ()

  • setPositionToCell (int X, int Y)

    Snaps entity anchored position to cell (X, Y).

  • moveToCell (int X, int Y)

    Begins smooth movement toward cell (X, Y).

  • allowRotation (bool IsAllow)

    Enables 4-direction rotation based on velocity.

  • atDestinationProperty ()

    Returns the ReadOnlyBooleanProperty for at-destination signal.