Phaser API Documentation

  Version: 
Only webGL mesh([x], [y], [texture], [frame], [vertices], [uvs], [indicies], [containsZ], [normals], [colors], [alphas])

Description:

Creates a new Mesh Game Object and adds it to the Scene.

Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser.

Parameters:

name type arguments Default description
x number <optional>

The horizontal position of this Game Object in the world.

y number <optional>

The vertical position of this Game Object in the world.

texture string | Phaser.Textures.Texture <optional>

The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager.

frame string | number <optional>

An optional frame from the Texture this Game Object is rendering with.

vertices Array.<number> <optional>

The vertices array. Either xy pairs, or xyz if the containsZ parameter is true.

uvs Array.<number> <optional>

The UVs pairs array.

indicies Array.<number> <optional>

Optional vertex indicies array. If you don't have one, pass null or an empty array.

containsZ boolean <optional> false

Does the vertices data include a z component?

normals Array.<number> <optional>

Optional vertex normals array. If you don't have one, pass null or an empty array.

colors number | Array.<number> <optional> 0xffffff

An array of colors, one per vertex, or a single color value applied to all vertices.

alphas number | Array.<number> <optional> 1

An array of alpha values, one per vertex, or a single alpha value applied to all vertices.

Returns:
Description:

The Game Object that was created.

Since: 3.0.0