I have finally gotten around to releasing my GIF writing lib for LOVE 0.10.x, which I hope should be pretty easy to drop into your projects. One advantage this project has is that it is threaded (as much as possible), so it can save your gifs while you play with a minimal performance hit (even less if you give it a canvas rather than a screenshot).
1466962294.gif (413.36 KiB) Viewed 12138 times
Here is some code with all of the important bits cut out so you can see the basic API:
love.graphics.newScreenshot will impede performance no matter what, if called every frame; then again, this is good for "non-realtime" gif-renders, if one serializes all inputs and the game is deterministic; they can render replays to gifs to watch. (quality/filesize ratio might not be the best for that though)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Trebgarta wrote:What about rendering to a canvas, and using that in both the screen and gifcat?
That may work better, didn't test it myself though, so can't say for certain.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
lib/gifcat/gifcat.lua:188: module 'gifcatlib' not found:
no field package.preload['gifcatlib']
no 'gifcatlib' in LOVE game directories.
no file 'gifcatlib.so' in LOVE paths.
no file './gifcatlib.lua'
no file '/usr/local/share/luajit-2.0.3/gifcatlib.lua'
no file '/usr/local/share/lua/5.1/gifcatlib.lua'
no file '/usr/local/share/lua/5.1/gifcatlib/init.lua'
no file './gifcatlib.so'
no file '/usr/local/lib/lua/5.1/gifcatlib.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Without seeing your code I'll tell you this. It defaults it FPS to the current FPS when you are making a gif. However that FPS will most likely go down due to making a new gif. So I would suggest trying to pass a dt argument to the :frame function. Setting the FPS just interprets how fast the frames you are sending it are. So saying you are giving it 60 fps where in reality you are giving it 30 will result in a gif 2x as fast. The dt argument in :frame will make it a variable framerate, thus reacting to how fast the game is actually going.
Yo, this looks awesome.
Would love to use it but I'm having some trouble.
Can't seem to build the library.
After a lot of different tries this is what I get.