natiny.resource.load
natiny.resource.load(path) -> resource
Synchronously loads a resource from disk (or network on web).
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Path to the resource file |
Returns
| Type | Description |
|---|---|
number |
Resource handle |
Example
local res = natiny.resource.load("data/image.png")
Notes
- This call blocks until the resource is fully loaded.
- Lua raises an error when loading fails.
- For non-blocking loading, see
natiny.resource.load_async.