Phaser API Documentation

addVertex(x, y, z, u, v, [color], [alpha])


Adds a new Vertex into the vertices array of this Mesh.

Just adding a vertex isn't enough to render it. You need to also make it part of a Face, with 3 Vertex instances per Face.


name type arguments Default description
x number

The x position of the vertex.

y number

The y position of the vertex.

z number

The z position of the vertex.

u number

The UV u coordinate of the vertex.

v number

The UV v coordinate of the vertex.

color number <optional> 0xffffff

The color value of the vertex.

alpha number <optional> 1

The alpha value of the vertex.


This Mesh Game Object.

Since: 3.50.0