SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Cut out surface
  2. if(!surface_exists(cutout)){
  3.     cutout = surface_create(room_width,room_height);
  4.     surface_set_target(cutout);
  5.    
  6.     draw_clear_alpha(c_black,1);
  7.    
  8.     draw_set_blend_mode(bm_subtract);
  9.     draw_sprite(sLayer,0,x,y);
  10.     draw_set_blend_mode(bm_normal);
  11.    
  12.     surface_reset_target();
  13. }
  14.  
  15. if(!surface_exists(cake)){
  16.     cake = surface_create(room_width,room_height);
  17.     surface_set_target(cake);
  18.  
  19.     draw_set_blend_mode(bm_subtract);
  20.     draw_surface(cutout,0,0);
  21.     draw_set_blend_mode(bm_normal);
  22.    
  23.     surface_reset_target();
  24. }else{
  25.     //Paint
  26.     if(mouse_check_button(mb_left)){
  27.         surface_set_target(cake);
  28.        
  29.         draw_set_color(oBrush.color);
  30.         draw_circle(mouse_x,mouse_y,8,false);
  31.         draw_line_width(mouse_xprev, mouse_yprev, mouse_x, mouse_y, 16);
  32.        
  33.         surface_reset_target();
  34.     }
  35.    
  36.     draw_surface(cake,0,0);
  37.     mouse_xprev = mouse_x;
  38.     mouse_yprev = mouse_y;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top