---
title: texture
framework: spritekit
role: symbol
role_heading: Instance Property
path: spritekit/skspritenode/texture
---

# texture

The texture used to draw the sprite.

## Declaration

```swift
var texture: SKTexture? { get set }
```

## Discussion

Discussion If the value is nil, the sprite is drawn as a single-color rectangle using its color property. Otherwise, the texture is used to draw the sprite. The related properties affect how the texture is applied. SpriteKit automatically generates a texture for sprites when they are initialized with init(imageNamed:).

## See Also

### Creating a Sprite from a Texture

- [init(texture:)](spritekit/skspritenode/init(texture:).md)
- [init(texture:color:size:)](spritekit/skspritenode/init(texture:color:size:).md)
- [init(texture:size:)](spritekit/skspritenode/init(texture:size:).md)
- [init(texture:normalMap:)](spritekit/skspritenode/init(texture:normalmap:).md)
