draw_sprite depth?

D

dugtrioramen

Guest
I've seen many questions about this online but there wasn't any answer to how to do it, just alternatives.

So i used draw_sprite_part to draw half of a sprite, and i want to draw the rest of the sprite at a greater depth.
I tried with draw_sprite_part(2nd half properties) {depth = 11}
but when i run the game, the whole sprite gets that depth.
I'm assuming changing depth like that will change the depth of the whole object despite using "with", but is there any other way to do it like that or something similar?
 

jo-thijs

Member
Depth only decides in which order draw events are executed.
Changing the depth inside a draw event doesn't do anything until the next frame.

There are only work arounds for this, but there are plenty of them.
I'm guessing you've read those already.

You can use multiple objects.
You can have surfaces.
You could use 3D.

For simplicity though, I highly recommend using the first suggestion.
Have some other instance created in the create event and set a variable to the id of the instance that created it.
Then make those 2 instances work together.
 
D

dugtrioramen

Guest
Depth only decides in which order draw events are executed.
Changing the depth inside a draw event doesn't do anything until the next frame.

There are only work arounds for this, but there are plenty of them.
I'm guessing you've read those already.

You can use multiple objects.
You can have surfaces.
You could use 3D.

For simplicity though, I highly recommend using the first suggestion.
Have some other instance created in the create event and set a variable to the id of the instance that created it.
Then make those 2 instances work together.
Actually I did try multiple objects but its working now with instance_create of the same object
thanks again
 
B

bojack29

Guest
You cant draw items at different depths. Only the depth by which the depth the object itself is drawing. You can drae things in different orders within the object but it is still at its desired depth.
 
Top