Page 1 of 1

Playing animated gif files

Posted: Sun May 20, 2018 3:05 am
by cmorgan
On the desktop I am able to import an animated gif and play it on a different card using this:

put image "airplane.gif" of card "card2" into card image "imageObject"

This doesn't play the animation in the iOS simulator. Is there another way to do this?

Re: Playing animated gif files

Posted: Thu Jun 14, 2018 12:46 pm
by richmond62
put image "airplane.gif" of card "card2" into card image "imageObject"
I'm not sure what the point of that is.

My inclination would be to check iOS documentation as to how it copes with animated GIF images.

Re: Playing animated gif files

Posted: Thu Jun 14, 2018 12:56 pm
by richmond62
http://www.idownloadblog.com/2017/07/14/gifroll/
Users have requested animated GIF support for years, but Apple waited until iOS 11 (Fall of 2017) to finally implement it.

Re: Playing animated gif files

Posted: Thu Jun 14, 2018 1:12 pm
by richmond62
Unfortunately, because of storage constraints,
the way that I tend to handle animated GIFS
(in a way that gives full programmatic control over animation)
is probably not worth considering.

Re: Playing animated gif files

Posted: Thu Jun 14, 2018 2:15 pm
by Klaus
Hi cmorgan,

welcome to the forum!
Does the GIF on card "card2" play on card "card2"?

Maybe animated GIFs are really not supported by iOS?
I don't know, I don't develop for mobile nor do I own any mobile device like a cellphone etc.

Hint:
... card image xxx
Is only accepted for HC compatibilty, you do not need to write this in LC anymore!
Just use IMAGE or BUTTON or whatever:
...
put img "airplane.gif" of cd "card2" into img "imageObject"
...


Best

Klaus

Re: Playing animated gif files

Posted: Thu Jun 14, 2018 6:11 pm
by jmburnod
Hi All,
Possible but very slow (iOS 11.4)
Maybe display a collection of .png would be faster
Best
Jean-Marc

Re: Playing animated gif files

Posted: Fri Jun 15, 2018 11:43 am
by richmond62
Maybe display a collection of .png would be faster
Indeed: If you open an animated GIF in GIMP it is easy (but tedious) to export its frames
as individual images.
-

Code: Select all

on mouseUp
   put 1 into KOUNT
   repeat until KOUNT > 32
      put ("jump" & KOUNT & ".png") into PIK
      set the backGroundPattern of grc "MB" to the ID of img PIK
      add 1 to KOUNT
      wait 3 ticks
   end repeat
end mouseUp
-
jump3.png
jump3.png (15.42 KiB) Viewed 6651 times
jump2.png
jump2.png (16.53 KiB) Viewed 6651 times
jump1.png
jump1.png (16.46 KiB) Viewed 6651 times
-
These stills are extracted from an animated GIF
composed from a sequence of photos by Eadweard Muybridge
that came to 512 KB, as did all the still PNG images:
so NO size overhead, pleasantly enough.