Phaser API Documentation

  Version: 
getTopRight([output], [includeParent])

Description:

Gets the top-right corner coordinate of this Game Object, regardless of origin.

The returned point is calculated in local space and does not factor in any parent Containers, unless the includeParent argument is set to true.

Parameters:

name type arguments Default description
output Phaser.Types.Math.Vector2Like <optional>

An object to store the values in. If not provided a new Vector2 will be created.

includeParent boolean <optional> false

If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns:
Description:

The values stored in the output object.

Since: 3.0.0