---
title: "init(contentsOf:withName:options:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/textureresource/init(contentsof:withname:options:)"
---

# init(contentsOf:withName:options:)

Asynchronously creates a texture resource from a file URL with creation options.

## Declaration

```swift
@MainActor @preconcurrency convenience init(contentsOf url: URL, withName resourceName: String? = nil, options: TextureResource.CreateOptions) async throws
```

## Parameters

- `url`: The path or address of the file to load into the texture resource.
- `resourceName`: A unique name the method assigns to the resource it loads, for use in network synchronization.
- `options`: The options to use when loading the resource.

## See Also

### Loading a texture

- [init(named:in:)](realitykit/textureresource/init(named:in:).md)
- [init(named:in:options:)](realitykit/textureresource/init(named:in:options:).md)
- [init(contentsOf:withName:)](realitykit/textureresource/init(contentsof:withname:).md)
- [load(named:in:)](realitykit/textureresource/load(named:in:).md)
- [load(named:in:options:)](realitykit/textureresource/load(named:in:options:).md)
- [load(contentsOf:withName:options:)](realitykit/textureresource/load(contentsof:withname:options:).md)
- [load(contentsOf:withName:)](realitykit/textureresource/load(contentsof:withname:).md)
- [loadAsync(named:in:)](realitykit/textureresource/loadasync(named:in:).md)
- [loadAsync(named:in:options:)](realitykit/textureresource/loadasync(named:in:options:).md)
- [loadAsync(contentsOf:withName:)](realitykit/textureresource/loadasync(contentsof:withname:).md)
