Wavertron Posted August 14, 2018 Share Posted August 14, 2018 Hey dudes Made a game for Ludum Dare 42. But during the mad 48 hour crunch, something went wrong with the Preloader in Canvas mode. On Firefox, I get the error "IndexSizeError: Index or size is negative or greater than the allowed amount" and the game crashes on the Preloader loading screen Without changing the code, it works fine Chrome everytime. I've found two workarounds: 1) In the Preloader class, if I comment out line 33 (below), the game loads fine in Firefox. this.load.on('progress', this.onProgress, this ); 2) If I load the game in WebGL mode, it works fine too. But I need to use Canvas mode as that was the only way I could get screeshots to work in my game (its a little photography game). In canvas mode, Firefox breaks. So the bug seems to related to the Preloader (image cropping?) and Canvas mode in Firefox. Searching the forums, Phaser 2 has had similar issues related to cropping images during the preloader. My game code can be found here: http://www.wavertron.com/ld42/ Link to comment Share on other sites More sharing options...
samme Posted August 14, 2018 Share Posted August 14, 2018 That's likely a problem with your crop function. Try setCrop instead? http://labs.phaser.io/edit.html?src=src/textures/crop texture image.js Link to comment Share on other sites More sharing options...
Wavertron Posted August 15, 2018 Author Share Posted August 15, 2018 Just tried it on my local, no luck. Same as before, Firefox in CANVAS mode still not working, Chrome is fine. Link to comment Share on other sites More sharing options...
samme Posted August 15, 2018 Share Posted August 15, 2018 Seems Firefox won't crop to width/height 0, so use at least 1px: https://codepen.io/samme/pen/djEQOm Link to comment Share on other sites More sharing options...
Recommended Posts