Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Create Event
- application_surface_draw_enable(false);
- var camera = view_get_camera(0);
- var cam_width = camera_get_view_width(view_camera[0]);
- var cam_height = camera_get_view_height(view_camera[0]);
- light_surface = surface_create(cam_width, cam_height);
- alpha = 0.5;
- ///Clean Up
- application_surface_draw_enable(true);
- ///Draw End
- var camera = view_get_camera(0);
- if (!surface_exists(self.light_surface)){
- var cam_width = camera_get_view_width(view_camera[0]);
- var cam_height = camera_get_view_height(view_camera[0]);
- self.light_surface = surface_create(cam_width, cam_height);
- }
- surface_set_target(self.light_surface);
- draw_clear(c_black);
- camera_apply(camera);
- gpu_set_blendmode(bm_subtract);
- with (obj_street_light){
- if (image_index == 1){
- draw_sprite(spr_light_source,0,x+13,y-2);
- }else if (image_index == 2){
- draw_sprite(spr_light_source,0,x-13,y-2);
- }else{
- draw_sprite(spr_light_source,0,x,y);
- }
- }
- gpu_set_blendmode(bm_normal);
- surface_reset_target();
- //Post Draw
- draw_surface(application_surface,0,0);
- draw_set_alpha(alpha);
- draw_surface_stretched(self.light_surface,0,0, window_get_width(), window_get_height());
- draw_set_alpha(1);
- window_center();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement