new MeshRope (options) overrides
Note: The wrap mode of the texture is set to REPEAT if textureScale
is positive.
Name | Type | Description |
---|---|---|
options |
MeshRopeOptions | |
options.texture |
The texture to use on the rope. |
|
options.points |
An array of Point objects to construct this rope. |
|
options.textureScale |
number |
Optional. Positive values scale rope texture keeping its aspect ratio. You can reduce alpha channel artifacts by providing a larger texture and downsampling here. If set to zero, texture will be stretched instead. |
Example
import { Point, MeshRope, Texture } from 'pixi.js';
for (let i = 0; i < 20; i++) {
points.push(new Point(i * 50, 0));
};
const rope = new MeshRope(Texture.from('snake.png'), points);
Extends
Members
re-calculate vertices by rope points each frame
Inherited Properties
From class Mesh
geometry inherited
Includes vertex positions, face indices, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU. Can be shared between multiple Mesh objects.
material inherited
Alias for shader.
roundPixels inherited
Whether or not to round the x/y position of the mesh.
shader inherited
Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. Can be shared between multiple Mesh objects.
texture inherited
The texture that the Mesh uses. Null for non-MeshMaterial shaders