S
Samus
Guest
I'm working on an improved lighting system in my game. Footage:
https://gph.is/2LcYwii
It looks good, I think, but I want a gradient circle. I used draw_circle_colour with both black and white, and I set the blend mode to subtract, thinking this would subtract a gradient circle from the black rectangle I had already drawn on the surface. I've tried this before, and I've seen it done in basically all lighting tutorials I've ever watched, but it just isn't working for me, it punches a flat gradient-less circle in the surface. Here is the code:
Any help is appreciated, Thanks!
It looks good, I think, but I want a gradient circle. I used draw_circle_colour with both black and white, and I set the blend mode to subtract, thinking this would subtract a gradient circle from the black rectangle I had already drawn on the surface. I've tried this before, and I've seen it done in basically all lighting tutorials I've ever watched, but it just isn't working for me, it punches a flat gradient-less circle in the surface. Here is the code:
Code:
///In the Begin step event
surface_free(global.shadow);
global.shadow = surface_create(1024, 768);
//Draw lighting sprite
surface_set_target(global.shadow)
draw_set_color(c_black);
draw_rectangle(0, 0, room_width, room_height,false);
draw_set_color(c_white);
draw_set_blend_mode(bm_subtract);
draw_circle_colour(obj_player.x, obj_player.y, 160, c_white, c_black, false);
draw_set_blend_mode(bm_normal);
Code:
///In the End Step event
//Reset target
surface_reset_target();
Code:
///In the Draw Event
//draw_set_blend_mode(bm_one);
draw_surface(global.shadow, 0, 0);