ForgeableSum Posted April 15, 2015 Share Posted April 15, 2015 Does anyone have Phaser code for a drag rectangle I could use? I'm speaking specifically of this sort of functionality, not in plain JS but with Phaser objects (e.g. Phaser.Rectangle or graphic) and input handlers. I could write it myself but would rather not! Link to comment Share on other sites More sharing options...
trasheater Posted April 17, 2015 Share Posted April 17, 2015 Its not the cleanest but I made a little example over lunch to show it could be done. http://jsfiddle.net/trasheater/pqmymygq/4/ You need to create a sprite along side your rectangle to check collisions. Well I couldn't get the graphics rectangle to colide with sprites so creating a sprite along side it seemd the best way to check the collision. Hope it helps ForgeableSum 1 Link to comment Share on other sites More sharing options...
ForgeableSum Posted April 17, 2015 Author Share Posted April 17, 2015 This is perfect - just what I was looking for, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts