Show / Hide Table of Contents

SquareGrid

Quick facts
GridSquareGrid
CellTypeSquareCellType
CellDirSquareDir
CellRotationSquareRotation
BoundSquareBound
Properties2d, Planar, Repeating, Infinite

SquareGrid is the most bog standard of all grids.

SquareGrid can also represent rectangles, just use the constructor which accepts a Vector2 cellSize.

Cell co-ordinates

Increasing the x co-ordinate of a cell moves right, and the y co-ordinate up. The cell (0, 0) has bounds from 0 to 1 in each axis (for a grid with cell size of 1). That means that the cell center of cell (0, 0) is at new Vector2(0.5f, 0.5f). This is the usual convention for square grids, but can be a bit surprising if you are not ready for it.

In This Article
Back to top Generated by DocFX