Hi,
I’ve been working with Corona for a while now and I recently got myself a copy of Level Director.
I have been using it to make a side-scroller. I found that implementing Level Director greatly changed how I made my game (I am sure in the end for the better) but at the moment I often reach complications that may have to do with my understanding of the how the level object is loaded and how to access object properties after it is loaded.
My current problem is as follows:
I have at the moment a dpad ( a circle object that listens for touch events) that gives the 360 degree control depending on the input. I also have a jump button (circle object with a tap listener). At first this all worked fine and I was able to have the dpad and jump events happen at the same time as I one would in a game. A common problem (which i have found other posts about) is if I begin a touch event on my dpad and slide off the dpad and release outside of it then my “ended” phase is never reached and the dpad remains active.
I attempted to use focus to solve the problem and it seemed to work but then i lost the ability to both jump and control the dpad simultaneously.
The next solution I believe should work is that I created another larger and invisible circle behind my dpad and I want it to check for move events that happen outside the dpad and deactivate the dpad when this occurs.
Similar to the process described here:
http://coronalabs.com/blog/2014/02/04/tutorial-continuous-actions-in-corona/
The problem I seem to be having is that I can’t get the invisible circle to be behind my dpad. ie. when I enter a move event on my dpad it’s registering a moved event also on the invisible circle (i have isHitTestable turned to true for the invisible circle). I tried to move the invisible circle and dpad circles to different levels in my Controls layer in LD but it still did not work as I desired. For reference though does lower on the list of the layer mean closer to the front of the display?
I basically need the dpad circle to have listener prominence over the circle behind it. So that the moved phase is only activated on the halo created by the intersection of my invisible circle and my dpad. Using the corona code toBack() does not work either because it fiddles with all the other objects such as my background and the like.
Any help on my specific problem or a solution to the slide off problem in general would be greatly appreciated.
Thanks.