You’re reading the docs for Phaser v4.0.0. The latest is Phaser v4.1.0.

Phaser.GameObjects.Components.GetBounds

Scope: static

Source: src/gameobjects/components/GetBounds.js#L11
Since: 3.0.0

Static functions

getBottomCenter

instancegetBottomCenter([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L239
Since: 3.18.0


getBottomLeft

instancegetBottomLeft([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L213
Since: 3.0.0


getBottomRight

instancegetBottomRight([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L265
Since: 3.0.0


getBounds

instancegetBounds([output])

Description:

Gets the axis-aligned bounding rectangle of this Game Object, regardless of origin.

The bounding rectangle is computed by retrieving all four corner positions of the Game Object (top-left, top-right, bottom-left, bottom-right), applying any rotation and parent Container transforms, and then calculating the smallest axis-aligned rectangle that fully encloses all four points.

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

Tags:

  • generic

Parameters:

nametypeoptionaldescription
outputPhaser.Geom.Rectangle | objectYesAn object to store the values in. If not provided a new Rectangle will be created.

Returns: Phaser.Geom.Rectangle, object - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L291
Since: 3.0.0


getCenter

instancegetCenter([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L57
Since: 3.0.0


getLeftCenter

instancegetLeftCenter([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L161
Since: 3.18.0


getRightCenter

instancegetRightCenter([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L187
Since: 3.18.0


getTopCenter

instancegetTopCenter([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L109
Since: 3.18.0


getTopLeft

instancegetTopLeft([output], [includeParent])

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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L83
Since: 3.0.0


getTopRight

instancegetTopRight([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.

Tags:

  • generic

Parameters:

nametypeoptionaldefaultdescription
outputPhaser.Types.Math.Vector2LikeYesAn object to store the values in. If not provided a new Vector2 will be created.
includeParentbooleanYesfalseIf this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?

Returns: Phaser.Types.Math.Vector2Like - The values stored in the output object.

Source: src/gameobjects/components/GetBounds.js#L135
Since: 3.0.0