flo71099 Posted February 24, 2015 Share Posted February 24, 2015 Hi everyone, I'am a new phaser developer, making some experiments,I want to know if there is an easy way to enable dragging an object horizontaly or verticaly (not diagonally) ? and also if it is possible to drag it automatically when it hit another object ? thanks Link to comment Share on other sites More sharing options...
rich Posted February 24, 2015 Share Posted February 24, 2015 Do you mean dragging as in with the mouse? If so there is a horizontal / vertical lock parameter to do this. Or did you mean something else? Link to comment Share on other sites More sharing options...
flo71099 Posted February 24, 2015 Author Share Posted February 24, 2015 Yes with the mouse, I've seen input.allowVerticalDrag/Horizontal, but I mean allowing both vertical and horizontal without diagonal. What I'am trying to do is dragging a block on x/y and stopping it when it hit another block (which can be dragging too). I can do this by making the object follow the mouse (with input.onDown and some math), but I just want to know if there is a better (and easier) way to do this. thanks. Link to comment Share on other sites More sharing options...
rich Posted February 24, 2015 Share Posted February 24, 2015 No there's no 4-way drag lock, you'd need to implement it yourself I'm afraid. It's a bit too edge case to make it into the InputrHandler I think Link to comment Share on other sites More sharing options...
flo71099 Posted February 24, 2015 Author Share Posted February 24, 2015 ok, no problem, thanks for your answer ... and for your great job on phaser Link to comment Share on other sites More sharing options...
Recommended Posts