Phaser API Documentation

  Version: 
setHitAreaFromTexture(gameObjects, [callback])

Description:

Sets the hit area for an array of Game Objects to be a Phaser.Geom.Rectangle shape, using the Game Objects texture frame to define the position and size of the hit area.

Parameters:

name type arguments description
gameObjects Phaser.GameObjects.GameObject | Array.<Phaser.GameObjects.GameObject>

An array of Game Objects to set as having an ellipse hit area.

callback Phaser.Types.Input.HitAreaCallback <optional>

The hit area callback. If undefined it uses Rectangle.Contains.

Returns:
Description:

This InputPlugin object.

Examples:
Since: 3.0.0