Phaser API Documentation

  Version: 
positionToCamera(camera, [output])

Description:

Takes a Camera and returns a Vector2 containing the translated position of this Pointer within that Camera. This can be used to convert this Pointers position into camera space.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera

The Camera to use for the translation.

output object | Phaser.Math.Vector2 <optional>

A Vector2-like object in which to store the translated position.

Returns:
Description:

A Vector2 containing the translated coordinates of this Pointer, based on the given camera.

Type:
Since: 3.0.0
Source: src/input/Pointer.js (Line 521)