I’m porting an existing game into Corona and I’m stuck right now with this little problem:
I have a virtual tray containing tiles (a la Scrabble) and the user drags tiles from the tray onto the playing board. But the tray extends off screen and I want to allow the user to swipe sideways to scroll the tray across screen to reveal the additional tiles.
So a "touch" event could either be the user dragging a tile onto the board, or it could be an attempt to scroll through the tray and I can’t know which until the "moved" phase event is generated. So in my tile dragging event handler I test to see whether the user has moved their finger more sideways than up-and-down the first time a "moved" event is generated and then try to pass focus to the tray like so:
if moveIsSideways then
display.getCurrentStage():setFocus( tray )
tray.isFocus = true
tile.isFocus = false
return false
end
But for whatever reason (and I suspect it’s because my handler returned true to the "began" event) the event never propagates to the tray and the tile remains active in drag mode (though because it doesn’t have the focus, it can get left behind by the finger/cursor and doesn’t necessarily receive the "ended" event).
Any ideas? [import]uid: 131885 topic_id: 22828 reply_id: 322828[/import]
Can i see your touch handler function? Then I can suggest the best way forward. [import]uid: 84637 topic_id: 22828 reply_id: 91262[/import]