Skip to content
This repository was archived by the owner on Jul 20, 2020. It is now read-only.

Conversation

@Dalas
Copy link

@Dalas Dalas commented Feb 3, 2017

This feature adds availability to control process of textures uploading in only one LoadingManager.

let manager = new THREE.LoadingManager();
manager.onProgress = function (url, itemsLoaded, itemsTotal ) {
    console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
};
manager.onLoad = function ( url, itemsLoaded, itemsTotal ) {
    console.log( 'Finish loading' );
};
this.loadingManager = manager;

........

<texture url="/texture1.png" loadingManager={ this.loadingManager } />
<texture url="/texture2.png" loadingManager={ this.loadingManager } />
<texture url="/texture3.png" loadingManager={ this.loadingManager } />

Console output:

Started loading file: /static/images/planets/texture1.png.
Loaded 1 of 3 files.
Started loading file: /static/images/planets/texture2.png.
Loaded 2 of 3 files.
Started loading file: /static/images/planets/texture3.png.
Loaded 3 of 3 files.
Finish loading

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant