---
title: "texture(from:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/skview/texture(from:)"
---

# texture(from:)

Renders the contents of a node tree and returns the rendered image as a texture.

## Declaration

```swift
func texture(from node: SKNode) -> SKTexture?
```

## Parameters

- `node`: The node object that is the root node of the tree you want to render to the texture.

## Mentioned in

Creating a New Node By Rendering To a Texture Loading and Using Textures

## Return Value

Return Value A SpriteKit texture that holds the rendered image.

## Discussion

Discussion The node being rendered does not need to appear in the view’s presented scene. The new texture is created with a size equal to the rectangle returned by the node’s calculateAccumulatedFrame() method. If the node is not a scene node, it is rendered with a clear background color ([``SKColor clear]).

## See Also

### Snapshotting Nodes to a Texture

- [texture(from:crop:)](spritekit/skview/texture(from:crop:).md)
- [Creating a New Node By Rendering To a Texture](spritekit/creating-a-new-node-by-rendering-to-a-texture.md)
