pixi.js
    Preparing search index...

    Interface SimpleMeshOptionsAdvanced

    Options for creating a SimpleMesh instance. Defines the texture, geometry data, and rendering topology for a basic mesh with direct vertex manipulation capabilities.

    // Create a basic textured triangle
    const mesh = new MeshSimple({
    texture: Texture.from('sprite.png'),
    vertices: new Float32Array([
    0, 0, // Vertex 1
    100, 0, // Vertex 2
    50, 100 // Vertex 3
    ]),
    uvs: new Float32Array([
    0, 0, // UV 1
    1, 0, // UV 2
    0.5, 1 // UV 3
    ])
    });

    // Create an indexed quad with custom topology
    const quadMesh = new MeshSimple({
    texture: Texture.from('square.png'),
    vertices: new Float32Array([
    0, 0, // Top-left
    100, 0, // Top-right
    100, 100, // Bottom-right
    0, 100 // Bottom-left
    ]),
    uvs: new Float32Array([
    0, 0, // Top-left
    1, 0, // Top-right
    1, 1, // Bottom-right
    0, 1 // Bottom-left
    ]),
    indices: new Uint32Array([
    0, 1, 2, // Triangle 1
    0, 2, 3 // Triangle 2
    ]),
    topology: 'triangle-list'
    });
    interface SimpleMeshOptions {
        indices?: Uint32Array;
        texture: Texture;
        topology?: Topology;
        uvs?: Float32Array;
        vertices?: Float32Array;
    }

    Hierarchy

    Index

    Properties

    indices?: Uint32Array

    Array of indices defining triangles. Each triangle is 3 indices into the vertices array.

    texture: Texture

    The texture to use

    topology?: Topology

    How vertices are connected to form triangles.

    • 'triangle-list': Individual triangles (default)
    • 'triangle-strip': Connected triangle strip
    • 'line-list': Lines between vertices
    • 'line-strip': Connected line strip
    • 'point-list': Points rendered individually
    'triangle-list'
    

    Array of UV coordinates for texture mapping. Each UV is 2 floats - u, v

    vertices?: Float32Array

    Array of vertex positions as x,y pairs. Each vertex is 2 floats - x, y