Hello.
I am making a computer for an upcoming game, and I’m using the drag scenes tutorial as a reference for creating and dragging new scenes. One thing that I’ve noticed is that setTopOnly doesn’t seem to work on these draggable scenes. Here is the documentation for setTopOnly.
The code I am using to create the scenes is very similar to what the demo shows.
I would think the solution would be to make win use setTopOnly, but the documentation says the default is true (which isn’t the behavior I’m getting). Any Ideas?
Hi @UltimateProGrammer,
In the drag scenes example, each new scene is created on top of the others, and never changes its z-index (depth). topOnly only affects the behavior of the input plugin, but not the z-index of the objects.
The Zone object (win) has the method setDepth for this task.
In your case the solution would be something like this:
Sorry, I should have been more clear in the original post.
For example, let’s say I have two windows. A is the one I’m trying to click on. B is the window behind A. Let’s say A has a really big button on it, and B also does. If I click on A’s button, but it happens that B’s button is right behind it, it will also trigger B. I can try to get a live demo, but I will have to do that wen I have more time later today.
Sorry if this is unclear, feel free to ask clarifying questions.
One thing I did notice now that I look at it again, is that win.on('pointerdown'... doesn’t trigger when this happens.