Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Mesh
Phaser.Types.Geom.Mesh

Type Definitions

GenerateGridConfig
Focus
Focus
Properties:
name type arguments Default description
texture string | Phaser.Textures.Texture

The texture to be used for this Grid. Must be a Texture instance. Can also be a string but only if the mesh property is set.

frame string | number <optional>

The name or index of the frame within the Texture.

mesh Phaser.GameObjects.Mesh <optional>

If specified, the vertices of the generated grid will be added to this Mesh Game Object.

width number <optional> 1

The width of the grid in 3D units. If you wish to get a pixel accurate grid based on a texture, you can use an Ortho Mesh or the isOrtho parameter.

height number <optional> width

The height of the grid in 3D units.

widthSegments number <optional> 1

The number of segments to split the grid horizontally in to.

heightSegments number <optional> widthSegments

The number of segments to split the grid vertically in to.

x number <optional> 0

Offset the grid x position by this amount.

y number <optional> 0

Offset the grid y position by this amount.

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.

tile boolean <optional> false

Should the texture tile (repeat) across the grid segments, or display as a single texture?

isOrtho boolean <optional> false

If set and using a texture with an ortho Mesh, the width and height parameters will be calculated based on the frame size for you.

flipY boolean <optional> false

If set and using a texture, vertically flipping render result.

Type:
object
Since: 3.50.0
Focus
Focus
GenerateGridVertsResult
Focus
Focus
Properties:
name type arguments Default description
verts Array.<number>

An array of vertex values in x, y pairs.

indices Array.<number>

An array of vertex indexes. This array will be empty if the tile parameter was true.

uvs Array.<number>

An array of UV values, two per vertex.

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.

Type:
object
Focus
Focus
GenerateVertsResult
Focus
Focus
Properties:
name type description
faces Array.<Phaser.Geom.Mesh.Face>

An array of Face objects generated from the OBJ Data.

vertices Array.<Phaser.Geom.Mesh.Vertex>

An array of Vertex objects generated from the OBJ Data.

Type:
object
Since: 3.50.0
Focus
Focus
OBJData
Focus
Focus
Properties:
name type description
materialLibraries Array.<string>

An array of material library filenames found in the OBJ file.

materials object

If the obj was loaded with an mtl file, the parsed material names are stored in this object.

models Array.<Phaser.Types.Geom.Mesh.OBJModel>

An array of parsed models extracted from the OBJ file.

Type:
object
Since: 3.50.0
Focus
Focus
OBJFace
Focus
Focus
Properties:
name type description
group string

The name of the Group this Face is in.

material string

The name of the material this Face uses.

vertices Array.<Phaser.Types.Geom.Mesh.OBJFaceVertice>

An array of vertices in this Face.

Type:
object
Since: 3.50.0
Focus
Focus
OBJFaceVertice
Focus
Focus
Properties:
name type description
textureCoordsIndex number

The index in the textureCoords array that this vertex uses.

vertexIndex number

The index in the vertices array that this vertex uses.

vertexNormalIndex number

The index in the vertexNormals array that this vertex uses.

Type:
object
Since: 3.50.0
Focus
Focus
OBJModel
Focus
Focus
Properties:
name type description
faces Array.<Phaser.Types.Geom.Mesh.OBJFace>

An array of Faces.

name string

The name of the model.

textureCoords Array.<Phaser.Types.Geom.Mesh.UV>

An array of texture coordinates.

vertexNormals Array.<Phaser.Types.Math.Vector3Like>

An array of vertex normals.

vertices Array.<Phaser.Types.Math.Vector3Like>

An array of vertices in the model.

Type:
object
Since: 3.50.0
Focus
Focus
UV
Focus
Focus
Properties:
name type description
u number

The u component.

v number

The v component.

w number

The w component.

Type:
object
Since: 3.50.0
Focus
Focus