---
title: "MTLRegionMake2D(_:_:_:_:)"
framework: metal
role: symbol
role_heading: Function
path: "metal/mtlregionmake2d(_:_:_:_:)"
---

# MTLRegionMake2D(_:_:_:_:)

Creates a 3D representation of a 2D region.

## Declaration

```swift
func MTLRegionMake2D(_ x: Int, _ y: Int, _ width: Int, _ height: Int) -> MTLRegion
```

## Parameters

- `x`: The x coordinate of the origin.
- `y`: The y coordinate of the origin.
- `width`: The width of the volume.
- `height`: The height of the volume.

## Return Value

Return Value A region whose x, y, width, and height values are as specified. The z coordinate of the region’s origin is set to 0, and the region’s depth is set to 1.

## See Also

### Creating regions

- [init()](metal/mtlregion/init().md)
- [init(origin:size:)](metal/mtlregion/init(origin:size:).md)
- [MTLRegionMake1D(_:_:)](metal/mtlregionmake1d(_:_:).md)
- [MTLRegionMake3D(_:_:_:_:_:_:)](metal/mtlregionmake3d(_:_:_:_:_:_:).md)
