natiny.resource.get_data

Lua
natiny.resource.get_data(resource) -> bytes

Returns the raw bytes of a loaded resource.

Parameters

Name Type Description
resource number Resource handle from natiny.resource.load

Returns

Type Description
string Resource bytes (binary-safe Lua string)

Example

Lua
local res = natiny.resource.load("file.bin")
local bytes = natiny.resource.get_data(res)