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

# texture(from:)

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

## Declaration

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

## Parameters

- `node`: A node object representing the root node of the tree to be render to the texture.

## 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 interface’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 clearColor]).

## See Also

### Snapshotting Nodes to a Texture

- [texture(from:crop:)](watchkit/wkinterfaceskscene/texture(from:crop:).md)
