al404 Posted July 1, 2016 Share Posted July 1, 2016 I found a way to display % a custom loading screen with this code // loading function MyLoadingScreen(text) { this.loadingUIText = text; } MyLoadingScreen.prototype.displayLoadingUI = function() { //alert(this.loadingUIText); } MyLoadingScreen.prototype.hideLoadingUI = function() { //alert("DONE!"); } var loadingScreen = new MyLoadingScreen(""); engine.loadingScreen = loadingScreen; also adding as second function this code to BABYLON.SceneLoader.ImportMesh i can display loading % of my main mesh , function (evt) { if (evt.lengthComputable) { $('#box-loading-txt').html("Loading, please wait..." + (evt.loaded * 100 / evt.total).toFixed() + "%"); } else { dlCount = evt.loaded / (1024 * 1024); $('#box-loading-txt').html("Loading, please wait..." + Math.floor(dlCount * 100.0) / 100.0 + " MB already loaded."); } }); since i also have some big texture and the assets to load i'm adding AssetsManager but i don't know hot to display a % of total file loading instead of my single mesh Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 1, 2016 Share Posted July 1, 2016 here is an example of waht we do for the main babylonjs site: https://github.com/BabylonJS/Samples/blob/master/js/loaderCustoms.js#L72 Quote Link to comment Share on other sites More sharing options...
al404 Posted July 1, 2016 Author Share Posted July 1, 2016 i saw that on one of the examples but as far as i understood you cont total assets and how many are already loaded mi issue is that i probably have 10 assets 5 are very light and the other 5 are between 300kb and 1Mb can't i retrive total assets weight? Boz 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 4, 2016 Share Posted July 4, 2016 Not from babylon.js unfortunately But as I see that you have a limited list of assets, you can still manually count remaining assets weight. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.