INDEX_SIZE_ERR: DOM Exception 1 - 300 images limit

  • Ashley are youre going to explain how you are making the spritesheet?? i would like to know how do you make that :D

    THANKS <img src="smileys/smiley31.gif" border="0" align="middle" />

  • This can not be a browser limitation since I have a game with ~700 images ( as animations frames ) and it plays OK on mobile browser ( Android 2.3.6 ), but can't compile using phonegap. I am not talking about exporting the C2 project for phonegap, but actually using that export into an eclipse phonegap compile, which throws the error ranma did mentioned.

    That leaves me no option but to think is a webview limitation. Now, my question: how come that the webview is different then the browser itself? Shouldn't be the same? Is there a way to overcome this limitation? How about using an expansion pack? Would that help ( if it's even possible )? In my case, reducing the files number from 700 to 300 is obviously ... not an option :)

  • xyboox - this is an old thread from March. We subsequently implemented automatic spritesheeting which should help mitigate the problem. If that doesn't fix it, it must be a severe limitation in the browser. We still recommend publishing using directCanvas or CocoonJS instead of PhoneGap, so I'm going to close this issue now.

  • Ashley, sorry to bring this back to discussion, but ... how about this:

    I tried to compile using first appMobi ( first using directCanvas, then using the webview ) with same results. Then I tried with Cocoon. Exact same result.

    Then, I reduced the frames in my animations to a little under 300 and... it works with all compilers: phonegap, appmobi and cocoon. I then started adding a few frames at a time, and as soon as their number is > 300, the same error is thrown for every method of compiling.

    However, it is not about the number of entities in the project, but specifically about the total number of images ( as animation frames ). I added sound files so that the number of objects passed well 300 and it still works as long as the number of items in "images" folder is < 300. Now, this might be because audio files are streamed ( maybe?).

    So... where this 300 come from? Who sets this limit?

    Thanks, any hint is welcome :)

    LE: if it matters, the code that throws the error in c2runtime.js is this ( inside the 'if' ):

    if (spritesheeted)

    {

       ctx.drawImage(cur_image, cur_frame.offx, cur_frame.offy, cur_frame.width, cur_frame.height, myx, myy, w, h);

    }

    Thanks.

  • xyboox - it's a limitation in the Android browser, there's nothing we can do to fix it. Newer versions of Android fix it, I believe.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks Ashley for the answer.

    It means the webview component is not an instance of the browser ( but a crippled one, am I right? ) since my animations run great when loaded directly into the same phone's browser.

    I just created an animation with more then 300 frames using EaselJS and even if the error is no longer thrown, the behavior is the same when compiled and run using any of phonegap, appmobi and cocoon. At least that proved it's not a C2 limitation but the phone's OS.

    So, will test on Android v. > 2.3.6 and iOS ( hopefully they don't have same limitations ).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)