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

    An Arcade Physics Collider will automatically check for collision, or overlaps, between two objects every step. If a collision, or overlap, occurs it will invoke the given callbacks.

    Note, if setting overlapOnly to true, and one of the objects is a TilemapLayer, every tile in the layer, regardless of tile ID, will be checked for collision. Even if the layer has had only a subset of tile IDs enabled for collision, all tiles will still be checked for overlap.

    Index

    Constructors

    Properties

    active: boolean

    Whether the collider is active.

    callbackContext: object

    The context the collideCallback and processCallback will run in.

    collideCallback: ArcadePhysicsCallback

    The callback to invoke when the two objects collide.

    name: string

    The name of the collider (unused by Phaser).

    The first object to check for collision.

    The second object to check for collision.

    overlapOnly: boolean

    Whether to check for collisions or overlaps.

    processCallback: ArcadePhysicsCallback

    If a processCallback exists it must return true or collision checking will be skipped.

    The world in which the bodies will collide.

    Methods

    • Removes Collider from World and disposes of its resources.

      Returns void

    • A name for the Collider.

      Phaser does not use this value, it's for your own reference.

      Parameters

      • name: string

        The name to assign to the Collider.

      Returns Collider

    • Called by World as part of its step processing, initial operation of collision checking.

      Returns void