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);
if (loader == null) {
loader = new TextureLoader(manager);
loader.flipY = true;
}
if (loader.setCrossOrigin != null) loader.setCrossOrigin(this.crossOrigin);
// var texture = loader.load( url, onLoad, onProgress, onError );
var texture = await loader.loadAsync(url, null);
if (mapping != null) texture.mapping = mapping;
return texture;
}