Does anyone have experience using PreloadJS within a CocoonJS Canvas+ app?
I have been trying and I am hit with the non-descript error (with no line number):
This code runs without error in the browser, but crashes under CocoonJS. When I make a simple test program and handle the loading myself everything runs fine, PreloadJS causes this error.
I have raised this with the CocoonJS staff and they suggest it may be PreloadJS using one of the unsupported features for CocoonJS.
Full details of the problem and a minimal example are below:
- Cocoon Version:
Current Developer App
- Basic description of the problem:
I have made a canvas game using EaselJS, PreloadJS and SoundJS that runs happily in browsers, I’d love to make this an app using CocoonJS. The same code that runs without error in a browser fails to load any assets in CocoonJS.
I’ve been chasing problems all day and have narrowed things down to a problem with PreloadJS in CocoonJS. Running the attached minimal example gives the error,
whereas it runs fine in browser, showing the simple image scrolling to the right.
If I avoid PreloadJS and load as an HTMLImage element instead then the code runs through fine, however I lose the pre-loading functionality I want from PreloadJS and the full game runs into errors trying to identify the bounds of images that haven’t loaded yet. I’d rather not reinvent the wheel and write my own preloader.
I’m hoping someone here has some insight into this problem, though I’m aware it may also be a problem better raised to the PreloadJS team.
If anyone has any advice I would be very happy.
My test device is:
Sony Z1 compact, running Android 5.1.1
Steps will reproduce the problem:
- Load the attached test case into the Dev App and run it as Canvas+
- See the error messages and console output.
Test image scrolls one pixel to the right each frame.
Reported error is:
Please find a minimal example here:
Framework/game engine (if relevant):
CreateJS suite: EaselJS, SoundJS and PreloadJS