gwaredd/UnityMarkdownViewer

Animated GIF support

Closed this issue · 3 comments

This is a great complement to my https://github.com/TheWizardsCode/DevLogger - a tool for keeping a DevLog from within Unity.

One of the features I need (and will add if/when I figure out how - no promises) is support for Animated GIFs. I post the idea hear in case anyone else is interested and wants to be notified if I ever do it and the code gets merged and more importantly, ask if anyone has any ideas how to get it done.

OK, I've done some initial research and it seems Unity has no easy way of displaying GIFs. I've seen quite a few hacky approaches that require the GIF to be unpacked into frames then played back flip-book style. I'm not going to do that (creating hundreds of files for a single image is not practical). I guess I could use a sprite sheet. Still looking for ideas.

Unpacking them into frames and playing the animation is the only way to do it. You wouldn't need separate files, just convert the frames to textures on load. Unity might do this automatically.

All that remains is to add the animation code to the update function.

Nice.. thanks I'll give this a test soon :-)