Binsk
Member
Howdy,
Alright, so I've always avoided instance deactivation and generally handled the 'deactivation' bit myself. However I am designing an extension that requires I "pause" objects regardless of how the user of the extension has programmed them. Because of this I am trying to use deactivation but am coming across weird depth sorting issues when I reactivate them.
For the sake of my demo I have two objects:
1) [gradient] -> draws a colored gradient over the room
2) [circle] -> draws a white circle inside the room
When I deactivate I loop through the active objects via with(all), deactivate them, then store their ids in a queue. When I need to activate them again I go through the queue and do so one by one. This method is used to prevent activating objects the user may have deactivated themselves at some other point.
The issue is this:
If I added gradient to the room last, everything works fine. If I added circle to the room last, it is always behind gradient upon reactivation. They are on the same layer inside the room editor with the circle always coming second, thus rendering correctly if I don't use deactivation.
Changing the order of activation (from queue to stack) does nothing and the only way I can seem to get this to work right is by placing each on their own layer via depth=, which I obviously can't do in this case.
Has anyone come across this issue and if so, how did you go about solving it?
EDIT:
I switched to just using instance_deactivate/activate_all for testing and it still has the issue so I suppose it has nothing to do with manually deactivating one-by-one. Not really sure how to solve this at this point, I'm still brainstorming.
Alright, so I've always avoided instance deactivation and generally handled the 'deactivation' bit myself. However I am designing an extension that requires I "pause" objects regardless of how the user of the extension has programmed them. Because of this I am trying to use deactivation but am coming across weird depth sorting issues when I reactivate them.
For the sake of my demo I have two objects:
1) [gradient] -> draws a colored gradient over the room
2) [circle] -> draws a white circle inside the room
When I deactivate I loop through the active objects via with(all), deactivate them, then store their ids in a queue. When I need to activate them again I go through the queue and do so one by one. This method is used to prevent activating objects the user may have deactivated themselves at some other point.
The issue is this:
If I added gradient to the room last, everything works fine. If I added circle to the room last, it is always behind gradient upon reactivation. They are on the same layer inside the room editor with the circle always coming second, thus rendering correctly if I don't use deactivation.
Changing the order of activation (from queue to stack) does nothing and the only way I can seem to get this to work right is by placing each on their own layer via depth=, which I obviously can't do in this case.
Has anyone come across this issue and if so, how did you go about solving it?
EDIT:
I switched to just using instance_deactivate/activate_all for testing and it still has the issue so I suppose it has nothing to do with manually deactivating one-by-one. Not really sure how to solve this at this point, I'm still brainstorming.
Last edited: