onetrickwolf Posted December 10, 2015 Share Posted December 10, 2015 Hi I am using Texture Packer to create texture atlases and loading them in (which Pixi's loader supports): https://github.com/kittykatattack/learningPixi#loadingatlas It works fine but I am now creating a preloader for my game and noticed that the "progress" only tracks the progress for the json file not the images the json file loads. So when I do this: loader.add(atlas_dir + 'main_menu_0.json').on('progress', loadProgressHandler).load(setup);function loadProgressHandler(loader, resource) {console.log('loading: ' + resource.url);console.log('progress: ' + loader.progress + '%');console.log('loading: ' + resource.name);loadingText.text = 'Loading ' + Math.round(loader.progress) + '%';renderer.render(stage);}The progress handler shows 100% complete and runs setup as soon as the JSON is done loading but the sprite sheet in main_menu_0.json will still be loading if I emulate a slow connection. Any idea what to do here? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 10, 2015 Share Posted December 10, 2015 It doesnt know real number of files before it loads that json file. You have to look at real number of files. onetrickwolf 1 Quote Link to comment Share on other sites More sharing options...
xerver Posted December 11, 2015 Share Posted December 11, 2015 Yeah the loader normally will handle cases like this, and not hit 100% until all resources are loaded (including discovered files from atlases) but there is one exception to that rule: if you load *only* one single atlas. A fix is to redesign the loader to not treat resources as complete until all subresources are completed, I've thought about this problem but haven't had time to reimplement the loading queue. In the meantime, this should feel better as you add more resources. onetrickwolf 1 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.