Phaser API Documentation

  Version: 
batchTri(gameObject, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, [texture], [unit])

Description:

Adds the vertices data into the batch and flushes if full.

Assumes 3 vertices in the following arrangement:

0
|\
| \
|  \
|   \
|    \
1-----2

Parameters:

name type arguments description
gameObject null | Phaser.GameObjects.GameObject

The Game Object, if any, drawing this quad.

x1 number

The bottom-left x position.

y1 number

The bottom-left y position.

x2 number

The bottom-right x position.

y2 number

The bottom-right y position.

x3 number

The top-right x position.

y3 number

The top-right y position.

u0 number

UV u0 value.

v0 number

UV v0 value.

u1 number

UV u1 value.

v1 number

UV v1 value.

tintTL number

The top-left tint color value.

tintTR number

The top-right tint color value.

tintBL number

The bottom-left tint color value.

tintEffect number | boolean

The tint effect for the shader to use.

texture WebGLTexture <optional>

WebGLTexture that will be assigned to the current batch if a flush occurs.

unit number <optional>

Texture unit to which the texture needs to be bound.

Returns:
Description:

true if this method caused the batch to flush, otherwise false.

Type:
  • boolean
Since: 3.50.0