Phaser API Documentation

  Version: 
Filter
Namespace: GetBounds
Phaser.GameObjects.Components.GetBounds

Methods

<private> prepareBoundsOutput(output, [includeParent])
Focus
Focus

Description:

Processes the bounds output vector before returning it.

Parameters:

name type arguments Default description
output Phaser.Types.Math.Vector2Like

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.18.0
Focus
Focus
getCenter([output], [includeParent])
Focus
Focus

Description:

Gets the center 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
Focus
Focus
getTopLeft([output], [includeParent])
Focus
Focus

Description:

Gets the top-left 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
Focus
Focus
getTopCenter([output], [includeParent])
Focus
Focus

Description:

Gets the top-center 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.18.0
Focus
Focus
getTopRight([output], [includeParent])
Focus
Focus

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
Focus
Focus
getLeftCenter([output], [includeParent])
Focus
Focus

Description:

Gets the left-center 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.18.0
Focus
Focus
getRightCenter([output], [includeParent])
Focus
Focus

Description:

Gets the right-center 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.18.0
Focus
Focus
getBottomLeft([output], [includeParent])
Focus
Focus

Description:

Gets the bottom-left 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
Focus
Focus
getBottomCenter([output], [includeParent])
Focus
Focus

Description:

Gets the bottom-center 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.18.0
Focus
Focus
getBottomRight([output], [includeParent])
Focus
Focus

Description:

Gets the bottom-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
Focus
Focus
getBounds([output])
Focus
Focus

Description:

Gets the bounds of this Game Object, regardless of origin.

The values are stored and returned in a Rectangle, or Rectangle-like, object.

Parameters:

name type arguments description
output object | Phaser.Geom.Rectangle <optional>

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

Returns:
Description:

The values stored in the output object.

Type:
Since: 3.0.0
Focus
Focus