natiny.resource.load

Lua
natiny.resource.load(path) -> resource

Synchronously loads a resource out of the mounted folders, or from disk (the network on web) when no mount holds it.

Parameters

Name Type Description
path string Name of the file inside a mounted folder, such as "textures/hero.png"

Returns

Type Description
number Resource handle; raises an error when loading fails

Example

Lua
local res = natiny.resource.load("textures/hero.png")