kamiyasi
Member
Here's my creation code
And here's the script I call when I want to change the background attached to the variable tmex
It works just fine the first time, but for an additional time I need to execute the script, the game crashes when I try to delete the background using background_delete. If someone can help me figure out why I would appreciate it.
Code:
tmex = background_create_colour(512, 512, c_gray);
tex = background_get_texture(tmex);
Code:
surf = surface_create(512, 512);
surface_set_target(surf);
draw_clear_alpha(c_black, 0);
draw_background_ext(bck_planet, 0, 0,1,1,0,color1,1);
draw_sprite_ext(spr_ring,0,0,0,1,1,0,color2,1);
surface_reset_target();
background_delete(tmex);
tmex = background_create_from_surface(surf, 0, 0, 512, 512, false, false);
tex = background_get_texture(tmex);