A
ajan-ko
Guest
So, basically I'm trying to create a glow effect, but it just doesn't work.
Here's my code.
By the way, I put that code to draw GUI. Here's the result
Here's my code.
Code:
if active {
color_fog=c_black;
draw_set_alpha(0.5);
//set the target
surface_set_target(fog);
draw_set_color(color_fog);
//draw the fog
draw_rectangle(0,0,camera_get_view_width(view_camera[0]),camera_get_view_height(view_camera[0]),0);
//draw the light source;
if instance_exists(obj_char)
with obj_char {
//substract the black rectagle
gpu_set_blendmode(bm_subtract);
light_size=120
draw_ellipse_color(x-light_size-camera_get_view_x(view_camera[0]),y-light_size-camera_get_view_y(view_camera[0]),x+light_size-camera_get_view_x(view_camera[0]),y+light_size-camera_get_view_y(view_camera[0]),c_white,c_black,0);
gpu_set_blendmode(bm_normal);
}
//draw the surface to origin
if surface_exists(fog){
draw_surface(fog,camera_get_view_x(view_camera[0]),camera_get_view_y(view_camera[0]));
}
draw_set_alpha(1);
surface_reset_target();
}
Last edited: