I'm re-doing the lighting system for my game, and this would be perfect for smooth lighting.
Please help or at least give feedback.
Posted 22 June 2012 - 12:02 AM
Posted 22 June 2012 - 12:19 AM
Posted 22 June 2012 - 01:03 AM
Two ways:
1) Draw the regular sprite. Then draw the sprite again on top of itself with color blending, using draw_sprite_ext() to add both the blend and the alpha.
2) Set the blending color to merge_color(c_white,COLOR,FACTOR); where COLOR is the color you want and FACTOR is a number between 0 and 1.
Posted 22 June 2012 - 01:10 AM
Posted 22 June 2012 - 01:13 AM
It depends on how you want them to interact and what the result should be, but it boils down to some simple math involving point_distance() and similar functions.
Posted 22 June 2012 - 01:17 AM
Posted 22 June 2012 - 01:28 AM
I need more info regarding exactly what you want to happen between these objects and the mouse position. I can't just write code without knowing what it should do.
image_blend=merge_color(c_white,COLOR,FACTOR)With my variation to give an illusion of an object having brightness:
image_blend=merge_color(c_white,c_black,distance_to_object(Light)*0.005)(0.005 is there so the light is larger.)
image_blend=merge_color(c_white,c_black,distance_to_object(Light_Other)*0.005)
image_blend=merge_color(c_white,c_black,distance_to_object(Light)*0.005) image_blend=merge_color(c_white,c_black,distance_to_object(Light_Other)*0.005)
Posted 22 June 2012 - 10:30 AM
var dist; dist = distance_to_object(instance_nearest(x,y,par_Light)); image_blend = merge_color(c_white,c_black,dist*0.005);
var f1, f2, ff; f1 = distance_to_object(Light)*0.005; f2 = distance_to_object(Light_Other)*0.005; ff = max(f1+f2,1); image_blend = merge_color(c_white,c_black,ff);
0 members, 0 guests, 0 anonymous users