NUGA Posted May 14, 2018 Share Posted May 14, 2018 Is it possible, and if so how, to play GIFs in phaser 3? Link to comment Share on other sites More sharing options...
NUGA Posted May 14, 2018 Author Share Posted May 14, 2018 For anyone interested, i solved this by converting my GIF to a sprite sheet. Keep in mind that if your sprite sheet has only 1 column, it may become to big of a file (in one of its dimensions) and unable to be loaded by phaser. If this happens, try making a matrix sprite sheet, that is, a sprite sheet with multiple column. Then just create an animation as you would with a simple character model (as in the 'making your first game' tutorial provided for phaser 3 getting started guide). Link to comment Share on other sites More sharing options...
squilibob Posted May 14, 2018 Share Posted May 14, 2018 I have investigated converting gifs to spritesheets at runtime and it seems every solution that I've come across involves using imagemagic. If you're not getting the gif from an external source then you should use a spritesheet. Link to comment Share on other sites More sharing options...
rich Posted May 14, 2018 Share Posted May 14, 2018 If you don't need to do too many of them then I personally use https://ezgif.com - you can upload a gif then split it to frames and download as a zip, can also do other edits too, then it's easy to string back together in an app like texture packer or shoebox. Link to comment Share on other sites More sharing options...
AndreasLoew Posted May 14, 2018 Share Posted May 14, 2018 I wonder: Do gifs work with webgl? Link to comment Share on other sites More sharing options...
rich Posted May 14, 2018 Share Posted May 14, 2018 Can’t see why not. I mean you’d only get the first frame, just like in canvas, but the browser can load it and there’s no logical reason it can’t make a gl texture from it. Link to comment Share on other sites More sharing options...
Recommended Posts