Herbert Posted June 20, 2019 Share Posted June 20, 2019 Hi there, I want to catch the error of the mismatch of sprite sheet and console out the filename with problem. I found this article(https://github.com/pixijs/pixi.js/issues/4599) which seems fulfill my need, but I follow the way shows in fiddles, and it doesn't work, onError is not triggered on 'Texture Error: frame does not fit inside the base Texture dimensions'. Did I miss something? PIXI.loader.onError.add(function(error, loader, resource) { console.log('catch error'); }); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 20, 2019 Share Posted June 20, 2019 use devtools debugger, place a breakpoint there, look in the stack, i guess? Quote Link to comment Share on other sites More sharing options...
Herbert Posted June 20, 2019 Author Share Posted June 20, 2019 I used to use devtools to do so, however, I hope to log or alert it out for some non-developer so they can re-upload sprite sheet by themselves. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 20, 2019 Share Posted June 20, 2019 Good idea! I recommend to patch that part of texture, like `Object.defineProperties(PIXI.Texture, { frame: { set: { function ... " so it doesnt produce error but adds a warning somewhere, with texture name from cache or whatever. I have many hacks like that when i give my games to designers Herbert 1 Quote Link to comment Share on other sites More sharing options...
Herbert Posted June 21, 2019 Author Share Posted June 21, 2019 Sounds good, I am going to do it this way, thanks @ivan.popelyshev ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
bbyford Posted May 21, 2020 Share Posted May 21, 2020 I get the same error when hosted but not on local. which seems odd, is there a max texture image size? do you normally split into several spritesheets? 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.