Camera and Pointer X,Y

I got a 600x500 screen and 1807x474 background image
I wanted to get the X and Y of the pointer outside of the camera since it only maxed to x: 600 and y: 500(Camera) and I wanted to get the 1000+ X pos for my game.

Create:

this.input.on('pointerdown', function(pointer){
	console.log("X: " + pointer.x + " Y: " + pointer.y);	    	
}.bind(this));

var cursors = this.input.keyboard.createCursorKeys();

var controlConfig = {
camera: this.cameras.main,
left: cursors.left,
right: cursors.right,
acceleration: 0.06,
drag: 0.0005,
maxSpeed: 1.0
};

this.controls = new Phaser.Cameras.Controls.SmoothedKeyControl(controlConfig);

UPDATE:

this.controls.update(delta);

I hope you all get my point.

Solved it using:
this.input.activePointer.worldX and this.input.activePointer.worldY

2 Likes