ForgeableSum Posted December 21, 2014 Share Posted December 21, 2014 Just like the title says... Camera: 800 x 400Bounds 3000 x 3000view: 800 x 400 No idea what the difference between view and camera is but that's beside the point. If I place a sprite using the x and y coordinates of the active pointer when pressed down, like so: x = game.add.sprite(clickedPosition.x, clickedPosition.y, 'x'); It works fine, until I move the camera. Then the sprite will be placed somewhere in the original window the browser loaded the page in (the window before the camera moved), but not where my pointer is. Link to comment Share on other sites More sharing options...
ForgeableSum Posted December 21, 2014 Author Share Posted December 21, 2014 Turns out, I needed to use worldX and worldY to get the coordinates relative to the game world as opposed to relative to the window. Like so: clickedPosition = game.input.activePointer; game.physics.arcade.moveToXY(unit, clickedPosition.worldX, clickedPosition.worldY,200); Link to comment Share on other sites More sharing options...
Recommended Posts