load method

  1. @override
dynamic load(
  1. dynamic url,
  2. Function onLoad, [
  3. Function? onProgress,
  4. Function? onError,
])
override

Implementation

@override
load(url, onLoad, [onProgress, onError]) {
  var scope = this;

  var loader = FileLoader(manager);
  loader.responseType = responseType;
  loader.setPath(path);
  loader.setRequestHeader(requestHeader);
  loader.setWithCredentials(scope.withCredentials);
  loader.load(url, (text) {
    var jsonData;

    jsonData = convert.jsonDecode(text);

    // try {
    // 	json = JSON.parse( text );
    // } catch ( e ) {
    // 	print( 'three.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' );
    // 	json = JSON.parse( text.substring( 65, text.length - 2 ) );
    // }

    var font = scope.parse(jsonData);

    onLoad(font);
  }, onProgress, onError);
}