texture.create
Client
Creates a new texture instance from a file path
Syntax
local instance = texture.create(
path
)Parameters
| Type | Name | Description |
|---|---|---|
string | path | File path to a supported texture asset Refer Formats section |
Returns
| Type | Name | Description |
|---|---|---|
texture | instance | Created texture instance |
Formats
| Format | Extension | Description |
|---|---|---|
| JPEG | .jpg | .jpeg | Lossy compressed image, best for photos |
| PNG | .png | Lossless compressed image, supports transparency |
| WebP | .webp | Modern format, supports both lossy and lossless |
Examples
local tex = texture.create("assets/photo.jpg")local tex = texture.create("assets/sprite.png")local tex = texture.create("assets/image.webp")