Basics
Guides
API Reference
Basics
Guides
API Reference
[14:7] extends: TraversableGrid
Wraps FXGL's AStarGrid, the default AStarCell-typed grid used by AStarPathfinder. All cells start WALKABLE; mark obstacles by calling get(x, y).setState("NOT_WALKABLE") before searching.
AStarGrid (int Width, int Height)
Creates a new AStarGrid of the given dimensions with all cells WALKABLE.
Width is the column count.Height is the row count.adopt (object Ajo)
Wraps an existing AStarGrid AussomJavaObject.
Ajo is an AussomJavaObject around an AStarGrid.A new wrapper.getWidth ()
Returns the grid width.
An int.getHeight ()
Returns the grid height.
An int.get (int X, int Y)
Returns the AStarCell at (X, Y).
X is the column.Y is the row.An AStarCell wrapper.isWithin (int X, int Y)
Returns whether (X, Y) is inside the grid.
X is the column.Y is the row.A bool._cellList (javaList)
getCells ()
Returns every cell in the grid.
A list of AStarCell wrappers.getWalkableCells ()
Returns only the walkable cells.
A list of AStarCell wrappers.getNeighbors (int X, int Y, string DirectionName = "FOUR_DIRECTIONS")
Returns the 4- or 8-neighborhood of (X, Y).
X is the column.Y is the row.DirectionName is "FOUR_DIRECTIONS" or "EIGHT_DIRECTIONS". Defaults to "FOUR_DIRECTIONS".A list of AStarCell wrappers.getOptional (int X, int Y)
Returns the cell at (X, Y) safely (null when off-grid).
X is the column.Y is the row.An AStarCell wrapper or null.fromWorld (object WorldObj, int WorldWidth, int WorldHeight, int CellWidth, int CellHeight, callback Mapping)
Builds an AStarGrid from the entities in a GameWorld. The Mapping callback receives each entity-type (or "" for empty cells) and must return a CellState enum AJO — use
CellState.get("WALKABLE")orCellState.get("NOT_WALKABLE").
WorldObj is a GameWorld wrapper.WorldWidth is the grid width in cells.WorldHeight is the grid height in cells.CellWidth is the per-cell pixel width.CellHeight is the per-cell pixel height.Mapping is a callback (typeValue) -> CellState AJO.A new AStarGrid wrapper.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.