Start a new topic

AnimatedImageDrawable not showing

AnimatedImageDrawable not showing


I'm using a sprite sheet which is 18000x2400. The key frame size is 400x600, so it is 4 rows and 45 columns. The file size is 1.4M.

The code I have:

  var monster = new AR.AnimatedImageDrawable(new AR.ImageResource("assets/alien.png"), 3, 400, 600, {
   horizontalAnchor: AR.CONST.HORIZONTAL_ANCHOR.CENTER,
   verticalAnchor: AR.CONST.VERTICAL_ANCHOR.BOTTOM,
  });
  monster.animate(, 10, -1);

The code does not throw exceptions, but all I see is a black rectangle. What maybe wrong? Is there any limitation on the sprite sheet such as file size or alignment?

Hello Jack,

I would suggest that you try and minimize the dimensions of your sprite sheet. Can you also please refer to the documentation here regarding more details on sprite sheets? 

Thanks

Eva,

I tried truncating my sprite sheet to 4 frames--so 1600x600--and it works, then I tried 30 frames, it does not work again. So it seems to be exactly the dimension limitation. Do you have documentation on this limitation? And how can I workaround it with AnimatedImageDrawable? I don't want to use gif or js.

Thank you.

Hi Jack,
You can't work around the limit we have regarding the size of image resources.

Best regards,

Andreas

Andreas,

what's the size limit for image resources then? I don't see it in docs.

Andreas,

What's the size limit for image resources? We need that infomation to guide our design work. Please help. Thanks!

Hi Jack,
You can't allocate more then 32 MB (all textures combined).

Best regards,

Andreas

Andreas,

I seems not able to animate a sprite sheet whose size is less than 1MB. However, after I scaled it a bit and realigned the frames, it works. The problem seems to be the size of the image, not the size of the file.

I'm using wikitude 5.1.4 and the issue exists both on android and iOS. I've attached both images. Can you try if you can repro? Thanks.

Hi Jack,
Was/is the image size a multiple of a single frame size? I'm pretty sure animated image drawables work with images < 1 MB but require a certain size to be 'parsable'.

Best regards,

Andreas

Andreas,

Yes it's multiple. See my attached file.
Login or Signup to post a comment