Makkeonmies
Member
So in my top-down viewed game, I have cloud shadows (transparent sprites) that occasionally fly over the levels.
They overlap tho, causing the overlapping section to go dark, and it looks bad.
I tried learning to use Surfaces to overcome this issue..... but honestly i dont have much clue how to work with them.
In a controller object, I put this:
Create:
Draw:
and then for the cloud objects: (obj_clouds)
Draw:
but it just keeps giving an Error:
'Variable obj_clouds.surf(100195, -2147483648) not set before reading it.
at gml_Object_obj_clouds_DrawEvent_1 (line 1) - surface_set_target(surf);'
Even though the cloud-generator-object does both create and draw the surface before these cloud-objects ever are created.
Why doesn't it recognize the surface?
They overlap tho, causing the overlapping section to go dark, and it looks bad.
I tried learning to use Surfaces to overcome this issue..... but honestly i dont have much clue how to work with them.
In a controller object, I put this:
Create:
GML:
surf = surface_create(room_width, room_height);
GML:
draw_surface_ext(surf, 0, 0, 0, 0, 0, c_white, 0.5);
Draw:
GML:
surface_set_target(surf);
draw_sprite(spr_clouds,random(3),x,y);
surface_reset_target();
'Variable obj_clouds.surf(100195, -2147483648) not set before reading it.
at gml_Object_obj_clouds_DrawEvent_1 (line 1) - surface_set_target(surf);'
Even though the cloud-generator-object does both create and draw the surface before these cloud-objects ever are created.
Why doesn't it recognize the surface?