phaser - v4.0.0-rc.4
    Preparing search index...

    Provides methods used for obtaining the bounds of a Game Object. Should be applied as a mixin and not used directly.

    interface GetBounds {
        getBottomCenter<O extends Vector2Like>(
            output?: O,
            includeParent?: boolean,
        ): O;
        getBottomLeft<O extends Vector2Like>(
            output?: O,
            includeParent?: boolean,
        ): O;
        getBottomRight<O extends Vector2Like>(
            output?: O,
            includeParent?: boolean,
        ): O;
        getBounds<O extends Geom.Rectangle>(output?: O): O;
        getCenter<O extends Vector2Like>(output?: O, includeParent?: boolean): O;
        getLeftCenter<O extends Vector2Like>(
            output?: O,
            includeParent?: boolean,
        ): O;
        getRightCenter<O extends Vector2Like>(
            output?: O,
            includeParent?: boolean,
        ): O;
        getTopCenter<O extends Vector2Like>(output?: O, includeParent?: boolean): O;
        getTopLeft<O extends Vector2Like>(output?: O, includeParent?: boolean): O;
        getTopRight<O extends Vector2Like>(output?: O, includeParent?: boolean): O;
    }

    Implemented by

    Index

    Methods

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

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

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

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O

    • 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.

      Type Parameters

      Parameters

      • Optionaloutput: O

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

      • OptionalincludeParent: boolean

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

      Returns O