<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKWarpGeometryGrid/init(columns:rows:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKWarpGeometryGrid(cm)gridWithColumns:rows:"
  },
  "title" : "init(columns:rows:)"
}
-->

# init(columns:rows:)

Creates a warp geometry grid of a specified size.

```
convenience init(columns cols: Int, rows: Int)
```

## Parameters

`cols`

The number of columns in the grid.

`rows`

The number of rows in the grid.

## Return Value

A new warp geometry grid object.

## Discussion

Creating a warp geometry grid without explicit source and destination positions automatically generates the required position arrays. For example, a 2 column by 2 row grid would create two arrays containing nine positions each, beginning at `[0,0]` - for the bottom left position - and ending at `[1,1]` - for the top left position.

|index: 6, position: [0.0, 1.0]|index: 7, position: [0.5, 1.0]|index: 8, position: [1.0, 1.0]|
|------------------------------|------------------------------|------------------------------|
|index: 3, position: [0.0, 0.5]|index: 4, position: [0.5, 0.5]|index: 5, position: [1.0, 0.5]|
|index: 0, position: [0.0, 0.0]|index: 1, position: [0.5, 0.0]|index: 2, position: [1.0, 0.0]|

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)