• 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!

Legacy GM surface sprite draw problem[SOLVED]

K

Kasra

Guest
Hi there
i have a sprite like this:
light.png
and i have a code like this (simple version):
Code:
if (surf_w != view_wview[0] + 1 && surf_h != view_hview[0] + 1)
{
    surface_free(surf);
    surf = surface_create(view_wview[0] + 1, view_hview[0] + 1);
    surf_w = view_wview[0] + 1;
    surf_h = view_hview[0] + 1;
}
surface_set_target(surf);
draw_clear(c_black);
draw_set_blend_mode(bm_src_color);
//******************************LIGHT AND EFFECTS**********************************//
draw_sprite_ext(light_00, 0, 200, 200, global.ar, global.ar, 0, c_white, 1);
//******************************LIGHT AND EFFECTS**********************************//
draw_set_blend_mode(bm_normal);
surface_reset_target();
var surf_x, surf_y;
draw_surface_ext(surf, view_xview[0] - 1, view_yview[0] - 1, 1, 1, 0, c_white, 1);
but the result is like this:
we.png
why did sprite draw like a rectangle ?!
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
bm_src_colour is a composite blend mode, ie: you need to use it with another bm_ in draw_set_blend_mode_ext(). Use one of the "complete" blend modes (ie: bm_add, bm_subtract, etc...) or use two of the composite ones in the correct function.
 
Top