vorrin Posted November 25, 2014 Report Share Posted November 25, 2014 Hello! I've got a situation as the below: two tiles (red) are contained within a larger one (blue). All tiles are sprites, and the red ones are children of the blue one. I want to be able to drag the tiles individually (ie. so I can drag 6 on 4), but if I drag one of them outside of the blue rectangle, I want the drag target, to become the larger, blue tile (containing the smaller ones). I made much of this work, I deactivate input on the blue tile, so that its red children, with input on, can be dragged , I detect when a red tile is dragged outside of the blue tile's hit area. My problem now, is, I don't know how to make phaser change the currently dragged item from a red tile, to the big blue one. I've tried a bunch of hacks, eventually got it half working with calling stop() and start() by hand on game.input.activePointer , but unsurprisingly that does not go well with touch input, and looks in general as a terrible way of doing that. Would anyone have a better idea on how to do this? Thanks! (here is a snippet of horrible code, showing the current solution, which happens in the update loop of the red tiles) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.