Advertisement
Tricky_Fat_Cat

GM2_GifRecorder

Oct 9th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //------------------------------------------------//
  2. // CREATE EVENT //
  3. //------------------------------------------------//
  4.  
  5. isRecording = false;
  6.  
  7.  
  8. //------------------------------------------------//
  9. // STEP EVENT //
  10. //------------------------------------------------//
  11.  
  12. var _recordPressed = keyboard_check_pressed(ord("T"));
  13.  
  14. if (_recordPressed)
  15. {
  16.     if (!isRecording)
  17.     {
  18.         isRecording = true;
  19.        
  20.         gifImage = gif_open(global.CurrentWidth, global.CurrentHeight);
  21.     }
  22.     else
  23.     {
  24.         isRecording = false;
  25.        
  26.         var _gifPath = get_save_filename("Animated Gif|*.gif", "");
  27.        
  28.         if (_gifPath != "")
  29.         {
  30.             gif_save(gifImage, _gifPath);
  31.         }
  32.     }
  33. }
  34.  
  35. if (isRecording)
  36. {
  37.     gif_add_surface(gifImage, application_surface, 2);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement