cellBounds method

Rect cellBounds(
  1. int cellX,
  2. int cellY
)

Converts grid coordinates to world bounds.

Given grid cell coordinates (x, y), returns the bounding rectangle in world/pixel coordinates.

Implementation

Rect cellBounds(int cellX, int cellY) {
  return Rect.fromLTWH(
    cellX * gridSize,
    cellY * gridSize,
    gridSize,
    gridSize,
  );
}