Advertisement
PureLV

Code

Jun 19th, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. ///Create Event
  2. application_surface_draw_enable(false);
  3.  
  4. var camera = view_get_camera(0);
  5. var cam_width = camera_get_view_width(view_camera[0]);
  6. var cam_height = camera_get_view_height(view_camera[0]);
  7.  
  8. light_surface = surface_create(cam_width, cam_height);
  9.  
  10. alpha = 0.5;
  11.  
  12.  
  13.  
  14. ///Clean Up
  15. application_surface_draw_enable(true);
  16.  
  17.  
  18.  
  19. ///Draw End
  20. var camera = view_get_camera(0);
  21.  
  22. if (!surface_exists(self.light_surface)){
  23. var cam_width = camera_get_view_width(view_camera[0]);
  24. var cam_height = camera_get_view_height(view_camera[0]);
  25.  
  26. self.light_surface = surface_create(cam_width, cam_height);
  27. }
  28.  
  29. surface_set_target(self.light_surface);
  30. draw_clear(c_black);
  31. camera_apply(camera);
  32.  
  33. gpu_set_blendmode(bm_subtract);
  34.  
  35. with (obj_street_light){
  36. if (image_index == 1){
  37. draw_sprite(spr_light_source,0,x+13,y-2);
  38. }else if (image_index == 2){
  39. draw_sprite(spr_light_source,0,x-13,y-2);
  40. }else{
  41. draw_sprite(spr_light_source,0,x,y);
  42. }
  43. }
  44.  
  45. gpu_set_blendmode(bm_normal);
  46.  
  47. surface_reset_target();
  48.  
  49.  
  50.  
  51. //Post Draw
  52.  
  53. draw_surface(application_surface,0,0);
  54.  
  55. draw_set_alpha(alpha);
  56. draw_surface_stretched(self.light_surface,0,0, window_get_width(), window_get_height());
  57. draw_set_alpha(1);
  58. window_center();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement