---
title: "newTexture(URL:options:)"
framework: metalkit
role: symbol
role_heading: Instance Method
path: "metalkit/mtktextureloader/newtexture(url:options:)"
---

# newTexture(URL:options:)

Synchronously loads image data and creates a new Metal texture from a given URL.

## Declaration

```swift
func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> any MTLTexture
```

## Parameters

- `URL`: The URL of the file to load.
- `options`: A dictionary describing any additional texture loading steps. See Texture Loading Options.

## Return Value

Return Value A fully loaded and initialized Metal texture, or nil if an error occurred.

## See Also

### Loading Textures from URLs

- [newTexture(URL:options:completionHandler:)](metalkit/mtktextureloader/newtexture(url:options:completionhandler:).md)
- [newTextures(URLs:options:error:)](metalkit/mtktextureloader/newtextures(urls:options:error:).md)
- [newTextures(URLs:options:completionHandler:)](metalkit/mtktextureloader/newtextures(urls:options:completionhandler:).md)
