C
cjcrack
Guest
Hello, i'm having a major issue and i'll try my best to explain it.
Say object 1 has a depth of 1 and object 2 has a depth of 0, so when overlapping, object 2 would be on top.
when I click with my mouse on the area they are overlapping, I only want the actions of the top object to occur, or the object with the lowest depth (in this case object 2)
In other words, when i click on overlapping objects, i ONLY want the lowest depth object to be "clicked" instead of having all the objects under the mouse being "clicked"
http://imgur.com/5JTvet8
So if i click in that overlapping red box region in this picture, i only want the actions of the top object to work (blue suit)
I'm guessing there is some type of depth priority code I can use for this when clicking the mouse. I know very very little code, all my games are like 95% drag and drop so if this does require some complicated code, a clear example of it would be greatly appreciated!
Say object 1 has a depth of 1 and object 2 has a depth of 0, so when overlapping, object 2 would be on top.
when I click with my mouse on the area they are overlapping, I only want the actions of the top object to occur, or the object with the lowest depth (in this case object 2)
In other words, when i click on overlapping objects, i ONLY want the lowest depth object to be "clicked" instead of having all the objects under the mouse being "clicked"
http://imgur.com/5JTvet8
So if i click in that overlapping red box region in this picture, i only want the actions of the top object to work (blue suit)
I'm guessing there is some type of depth priority code I can use for this when clicking the mouse. I know very very little code, all my games are like 95% drag and drop so if this does require some complicated code, a clear example of it would be greatly appreciated!