You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there
I have a game where users can upload their own spritesheets. However when they make a mistake, e.g. a sprite that is 1 pixel too narrow, the error 'Texture Error: frame does not fit inside the base Texture dimensions' is thrown in the console. And the entire game stops loading. I currently do not see a way to try/catch that inside my game code. Is it possible to allow the the game developer to handle this exception ?
Or to provide a function to "test" assets before loading them
Thanks 👍
My current workaround is
PIXI.Texture.prototype.setFrame=function(frame){
...
if(!this.trim&&(frame.x+frame.width>this.baseTexture.width||frame.y+frame.height>this.baseTexture.height)){this.valid=false;return;//throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this);}