Phaser API Documentation

  Version: 
setHitAreaTriangle(gameObjects, x1, y1, x2, y2, x3, y3, [callback])

Description:

Sets the hit area for an array of Game Objects to be a Phaser.Geom.Triangle shape, using the given coordinates to control the position of its points.

Parameters:

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

An array of Game Objects to set as having a triangular hit area.

x1 number

The x coordinate of the first point of the triangle.

y1 number

The y coordinate of the first point of the triangle.

x2 number

The x coordinate of the second point of the triangle.

y2 number

The y coordinate of the second point of the triangle.

x3 number

The x coordinate of the third point of the triangle.

y3 number

The y coordinate of the third point of the triangle.

callback Phaser.Types.Input.HitAreaCallback <optional>

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

Returns:
Description:

This InputPlugin object.

Examples:
Since: 3.0.0