timinman Posted August 6, 2015 Share Posted August 6, 2015 http://inmans.org/hummingbird I'm using a listener to respond to a pointer click by moving my sprite to where the pointer was clicked. It works predictably until the sprite scrolls past the stage width (the camera is following my sprite). Once the camera follows the sprite past it's starting orientation, it doesn't seem to correctly calculate the position the pointer was clicked. You can see the relevant code here: https://github.com/thehack/hummingbird/blob/master/game.js Am I mixing incompatible features? Link to comment Share on other sites More sharing options...
timinman Posted August 6, 2015 Author Share Posted August 6, 2015 This post: http://www.html5gamedevs.com/topic/15116-add-camera-offset-to-mouse-pointer-when-dragging-sprite/ helped. It needs to be:game.input.mousePointer.worldX (or worldY), rather than:game.input.mousePointer.x Link to comment Share on other sites More sharing options...
Recommended Posts