patchouliwater
Member
I am trying to make an object's sprite overlay its self onto one of another object, the latter object should change size. However, I am having two problems:
The first object is rendering below the object it should be overlaying.
The second object does not change size at all.
My objects are set up as such:
The first object (objMaskTestObject), which is supposed to project on top of the second object:
Create Event
Draw Event
The second object, which should increase in size but does not.
Create Event
Step Event
Draw Event
I am unsure what is wrong with my code. The first object is drawing, it is just below the second and I have no idea why (you can see it if you change the alpha value on the second object's draw_sprite_ext), and the size of the second object does not visually increase whilst in the same room as the other object. I tried to make it versatile so I could have multiple of the first object drawing over the 2nd, which is why I didn't lump all the draw code into one object.
The first object is rendering below the object it should be overlaying.
The second object does not change size at all.
My objects are set up as such:
The first object (objMaskTestObject), which is supposed to project on top of the second object:
Create Event
GML:
depth = -100;
GML:
if(surface_exists(objMaskTest.keySurface)){
surface_set_target(objMaskTest.keySurface);
gpu_set_colorwriteenable(1, 1, 1, 0);
draw_sprite(sprite_index, image_index, x, y);
gpu_set_colorwriteenable(1, 1, 1, 0);
surface_reset_target();
}
Create Event
GML:
keySurface = -1;
circleExpansion = 0;
depth = 10;
GML:
circleExpansion += 0.1;
GML:
if (!surface_exists(keySurface)){
keySurface = surface_create(room_width, room_height);
}
surface_set_target(keySurface);
draw_sprite_ext(sprite_index, image_index, x, y, circleExpansion, circleExpansion, 0, -1, 1);
surface_reset_target();
draw_surface(keySurface, 0, 0);