Windows How to make gifs

Yal

šŸ§ *penguin noises*
GMC Elder
Game Maker has built-in functions to capture GIFs these days, too! It's a bit tricky to set up (you gotta allocate a buffer and manually store image data to it using surfaces) but it has the advantage that you can have it in the final game later, to e.g. let players save GIF replays of cool moments.
 

mar_cuz

Member
Game Maker has built-in functions to capture GIFs these days, too! It's a bit tricky to set up (you gotta allocate a buffer and manually store image data to it using surfaces) but it has the advantage that you can have it in the final game later, to e.g. let players save GIF replays of cool moments.
Any tutorials out there for doing that?
 

rytan451

Member
GML:
// To begin a GIF
gif = gif_open(surface_get_width(application_surface), surface_get_height(application_surface));

// Each frame you want to record the whole game screen. This would probably be in the post draw event
gif_add_surface(gif, application_surface, 100/room_speed);

// When you're done recording, and want to save it
gif_save(gif, "filename.gif");
If I understand the manual correctly, then this should save the GIF to the working directory. In Windows, that would be %localappdata%/<GAME NAME> (Insert the proper game name there).
 

mar_cuz

Member
GML:
// To begin a GIF
gif = gif_open(surface_get_width(application_surface), surface_get_height(application_surface));

// Each frame you want to record the whole game screen. This would probably be in the post draw event
gif_add_surface(gif, application_surface, 100/room_speed);

// When you're done recording, and want to save it
gif_save(gif, "filename.gif");
If I understand the manual correctly, then this should save the GIF to the working directory. In Windows, that would be %localappdata%/<GAME NAME> (Insert the proper game name there).
Awesome will try it
 
Top