core.texture.create
Client
Creates a new texture instance from a file path
Syntax
local instance = core.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 |
| BMP | .bmp | Uncompressed bitmap, no lossy artifacts |
| DDS | .dds | GPU-native compressed format, ideal for 3D assets |
| KTX | .ktx | .ktx2 | Khronos texture format, supports GPU compression and mipmaps |
Examples
local entity = core.texture.create("assets/photo.jpg")local entity = core.texture.create("assets/sprite.png")local entity = core.texture.create("assets/image.webp")local entity = core.texture.create("assets/terrain.dds")