S
squirrelah
Guest
Hello, i have a game where i am constantly drawing a surface across the entire screen and using it as a "fog of war". Technically i am drawing two surfaces, one black one and one transparent one, and this is the transparent one but i don't think thats relevant.
Basically whenever i am debugging and i minimize, and then unminimize i get the error
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object oFog:
Trying to set a surface target that does not exist.
at gml_Object_oFog_Step_0 (line 2) - surface_set_target(sFog);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oFog_Step_0 (line 2)
Below is my code for all 3 events.
Does anyone know why this is happening or how to fix it?
Basically whenever i am debugging and i minimize, and then unminimize i get the error
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object oFog:
Trying to set a surface target that does not exist.
at gml_Object_oFog_Step_0 (line 2) - surface_set_target(sFog);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oFog_Step_0 (line 2)
Below is my code for all 3 events.
Code:
////STEP CODE
surface_set_target(sFog);
draw_clear(c_gray);
surface_reset_target();
//////DRAW CODE
draw_surface_ext(sFog, 0, 0, res, res, 0, 0, .5);
///////CREATE CODE
res = 3;
depth = -7;
sFog = surface_create(room_width/res,room_height/res);