How to use the @pixi/mesh.MeshMaterial function in @pixi/mesh

To help you get started, we’ve selected a few @pixi/mesh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pixijs / pixi.js / packages / mesh-extras / src / SimplePlane.js View on Github external
constructor(texture, verticesX, verticesY)
    {
        const planeGeometry = new PlaneGeometry(texture.width, texture.height, verticesX, verticesY);
        const meshMaterial = new MeshMaterial(Texture.WHITE);

        super(planeGeometry, meshMaterial);

        // lets call the setter to ensure all necessary updates are performed
        this.texture = texture;
    }
github pixijs / pixi.js / packages / mesh-extras / src / SimpleMesh.js View on Github external
constructor(texture = Texture.EMPTY, vertices, uvs, indices, drawMode)
    {
        const geometry = new MeshGeometry(vertices, uvs, indices);

        geometry.getBuffer('aVertexPosition').static = false;

        const meshMaterial = new MeshMaterial(texture);

        super(geometry, meshMaterial, null, drawMode);

        /**
         * upload vertices buffer each frame
         * @member {boolean}
         */
        this.autoUpdate = true;
    }
github pixijs / pixi.js / packages / mesh-extras / src / SimpleRope.js View on Github external
constructor(texture, points)
    {
        const ropeGeometry = new RopeGeometry(texture.height, points);
        const meshMaterial = new MeshMaterial(texture);

        super(ropeGeometry, meshMaterial);

        /**
         * re-calculate vertices by rope points each frame
         *
         * @member {boolean}
         */
        this.autoUpdate = true;
    }

@pixi/mesh

Core Mesh functionality

MIT
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis