Basics
Guides
API Reference
Basics
Guides
API Reference
[20:7] extends: FxObj
Wraps FXGL's Grid, a typed 2D array of Cell subclasses with cell neighbor queries. Most game code uses AStarGrid (chunk 4 pathfinding) rather than constructing a Grid directly, but for tile-map storage and simple cell queries Grid is the building block. The default constructor builds an AussomSimpleCell-typed grid of the given dimensions. Cell access (get / set) returns Cell wrappers; neighbor queries return a list of Cell wrappers.
Grid (int Width, int Height, int CellWidth = 0, int CellHeight = 0)
Creates a new Grid of the given dimensions pre-populated with AussomSimpleCells.
Width is the column count.Height is the row count._makeCell (X, Y)
Internal — supplies cells to the Grid ctor's CellGenerator.
adopt (object Ajo)
Wraps an existing Grid AussomJavaObject.
Ajo is an AussomJavaObject around an FXGL Grid.A new wrapper.getWidth ()
Returns the grid width (column count).
An int.getHeight ()
Returns the grid height (row count).
An int.getCellWidth ()
Returns the per-cell width in pixels.
An int.getCellHeight ()
Returns the per-cell height in pixels.
An int.isWithin (int X, int Y)
Returns true if (X, Y) is inside the grid bounds.
X is the column.Y is the row.A bool.get (int X, int Y)
Returns the Cell at (X, Y).
X is the column.Y is the row.A Cell wrapper.set (int X, int Y, object CellObj)
Replaces the cell at (X, Y) with the provided Cell.
X is the column.Y is the row.CellObj is a Cell wrapper.this objectgetNeighbors (int X, int Y, string DirectionName = "FOUR_DIRECTIONS")
Returns the list of neighboring cells around (X, Y). The NeighborDirection name controls whether to include diagonals.
X is the column.Y is the row.DirectionName is the NeighborDirection name (defaults to "FOUR_DIRECTIONS").A list of Cell wrappers.getCells ()
Returns the list of all cells in the grid.
A list of Cell wrappers._opt (rawAjo)
getRight (int X, int Y)
Returns the cell directly right of (X, Y), or null when off the grid.
A Cell wrapper or null.getLeft (int X, int Y)
Returns the cell directly left of (X, Y), or null.
A Cell wrapper or null.getUp (int X, int Y)
Returns the cell directly above (X, Y), or null.
A Cell wrapper or null.getDown (int X, int Y)
Returns the cell directly below (X, Y), or null.
A Cell wrapper or null.getUpRight (int X, int Y)
Returns the cell diagonally up-right of (X, Y), or null.
A Cell wrapper or null.getUpLeft (int X, int Y)
Returns the cell diagonally up-left of (X, Y), or null.
A Cell wrapper or null.getDownRight (int X, int Y)
Returns the cell diagonally down-right of (X, Y), or null.
A Cell wrapper or null.getDownLeft (int X, int Y)
Returns the cell diagonally down-left of (X, Y), or null.
A Cell wrapper or null.getOptionalByPixels (double Px, double Py)
Returns the cell at the given pixel coordinates (using cellWidth / cellHeight to map), or null when outside the grid.
Px is the pixel X.Py is the pixel Y.A Cell wrapper or null.getOptional (int X, int Y)
Returns the cell at (X, Y) safely, returning null when off the grid instead of throwing.
A Cell wrapper or null.getRandomCell ()
Returns a random cell from the grid.
A Cell wrapper.forEach (callback Action)
Calls Action(cell) for every cell in the grid.
Action is a callback (cell) -> void.this objectgetData ()
Returns the raw 2D array of cells as an AussomJavaObject. Most callers prefer getCells or forEach; reach for getData only when iterating in 2D index space.
An AussomJavaObject around a 2D Cell array.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.