natiny.texture.create
natiny.texture.create(resource) -> texture
Creates a texture from an image resource.
Parameters
| Name | Type | Description |
|---|---|---|
resource |
number |
Resource handle containing encoded image data |
Returns
| Type | Description |
|---|---|
number |
Texture handle; raises an error when the resource is invalid, image decoding fails, or allocation fails |
Example
local texture = natiny.texture.create(image_resource)
Notes
- Image data is copied, so the resource can be destroyed after this call.