Punknoodles Posted August 20, 2017 Share Posted August 20, 2017 I have a world larger than the screen and am trying to add a custom cursor. However, the cursor seems to move relative to the world, so I tried using fixedToCamera = true, but then it didn't move at all. Here's the relevant code: // create event customcursor = game.add.sprite(game.input.mousePointer.x, game.input.mousePointer.y, 'cursor'); customcursor.scale.setTo(0.5, 0.5); customcursor.anchor.setTo(0.5, 0.5); customcursor.fixedToCamera = true; // update event customcursor.x = game.input.mousePointer.x; customcursor.y = game.input.mousePointer.y; If anyone knows what's wrong with this, please tell me! Link to comment Share on other sites More sharing options...
Punknoodles Posted August 20, 2017 Author Share Posted August 20, 2017 Nevermind, it was customcursor.cameraOffset.x and y. Link to comment Share on other sites More sharing options...
Sturb Posted August 22, 2017 Share Posted August 22, 2017 You could set fixedToCamera to false, and just set your 'customcursor' position to the input's world position by using 'game.input.worldX' and game.input.worldY'. This way you don't need to worry about taking any camera offsets into account because the world position of input already does that for you. Link to comment Share on other sites More sharing options...
Recommended Posts