• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Draw particles only inside of primitive?

M

mastmartelli

Guest
I have this in my draw event:
Code:
if (!surface_exists(surf)) surf = surface_create(room_width, room_height);

//set surface as drawing target
surface_set_target(surf);

draw_clear_alpha(1, 0);

//draw particles to surface
part_system_drawit(global.partSys);

gpu_set_blendmode(bm_subtract);

with (oGrabberCenter) {
    //bucket primitive
    draw_primitive_begin(pr_trianglestrip);
    draw_vertex(bbox_left, bbox_bottom);
    draw_vertex(bbox_right, bbox_bottom);
    draw_vertex(bbox_left, bbox_top);
    draw_vertex(bbox_right, bbox_top);
    draw_primitive_end();
}

gpu_set_blendmode(bm_normal);
surface_reset_target();
draw_surface(surf, 0, 0);
This will draw the particles everywhere except inside of the primitive, is there anyway to do the opposite?
 
Last edited by a moderator:
Top