loadTexture method
dynamic
loadTexture(
- dynamic url,
- dynamic mapping,
- dynamic onLoad,
- dynamic onProgress,
- dynamic onError,
Implementation
loadTexture(url, mapping, onLoad, onProgress, onError) async {
var manager = (this.manager != null) ? this.manager : defaultLoadingManager;
var loader = manager.getHandler(url);
loader ??= TextureLoader(manager);
if (loader.setCrossOrigin != null) loader.setCrossOrigin(crossOrigin);
// var texture = loader.load( url, onLoad, onProgress, onError );
var texture = await loader.loadAsync(url, null);
if (mapping != null) texture.mapping = mapping;
return texture;
}