---
title: gridWidth
framework: gameplaykit
role: symbol
role_heading: Instance Property
path: gameplaykit/gkgridgraph/gridwidth
---

# gridWidth

The number of possible x-coordinates in the grid.

## Declaration

```swift
var gridWidth: Int { get }
```

## Discussion

Discussion You specify origin, width, and height when creating a grid graph with the init(fromGridStartingAt:width:height:diagonalsAllowed:) initializer. After initialization, you can use this property to examine the parameters the graph was created with—for example, to draw the grid as a debugging overlay in your game UI.

## See Also

### Inspecting a Graph

- [diagonalsAllowed](gameplaykit/gkgridgraph/diagonalsallowed.md)
- [gridOrigin](gameplaykit/gkgridgraph/gridorigin.md)
- [gridHeight](gameplaykit/gkgridgraph/gridheight.md)
