---
title: textureRect()
framework: spritekit
role: symbol
role_heading: Instance Method
path: spritekit/sktexture/texturerect()
---

# textureRect()

Gets a rectangle that defines the portion of the texture used to render its image.

## Declaration

```swift
func textureRect() -> CGRect
```

## Return Value

Return Value A rectangle in the unit coordinate space.

## Discussion

Discussion The default value is a rectangle that covers the entire texture (0,0) - (1,1). You cannot set this value directly; to use only a portion of a texture, use the init(rect:in:) method to create a new texture.

## See Also

### Reading a Texture’s Size and Optional Source Location

- [size()](spritekit/sktexture/size().md)
