Loader¶
The Loader module is responsible for loading additional resources into the engine.
Reference¶
- loader.getItemCountToLoad()¶
Return how many items are currently beeing loaded
- loader.loadTexture(id, options)¶
Loads a texture by its item ID
- loader.loadMaterial(id)¶
Loads a material by ID and will emit an loadMaterialResult event when the material is ready or loadMaterialError event on error
- loader.loadMesh(id)¶
Loads a material by ID and will emit an loadMaterialResult event when the material is ready or loadMaterialError event on error
Examples¶
local Loader = require 'engine/loader'
function init()
Loader.loadTexture("<texture item id>"):next(function(texture)
print("Loaded the texture: ", texture:getName())
end)
end