phaser - v4.0.0-rc.4
    Preparing search index...
    • A Matter Game Object is a generic object that allows you to combine any Phaser Game Object, including those you have extended or created yourself, with all of the Matter Components.

      This enables you to use component methods such as setVelocity or isSensor directly from this Game Object.

      Parameters

      • world: Physics.Matter.World

        The Matter world to add the body to.

      • gameObject: GameObject

        The Game Object that will have the Matter body applied to it.

      • Optionaloptions: MatterJS.Body | MatterBodyConfig

        A Matter Body configuration object, or an instance of a Matter Body.

      • OptionaladdToWorld: boolean

        Should the newly created body be immediately added to the World? Default true.

      Returns GameObject