PIXI.RopeGeometry
class RopeGeometry extends PIXI.MeshGeometry
RopeGeometry allows you to draw a geometry across several points and then manipulate these points.
for (let i = 0; i < 20; i++) {
points.push(new PIXI.Point(i * 50, 0));
};
const rope = new PIXI.RopeGeometry(100, points);
Constructor
new PIXI.RopeGeometry(width: number, points: IPoint[], textureScale: number) → {}
Name | Type | Default | Description |
---|---|---|---|
width | number | 200 |
The width (i.e., thickness) of the rope. |
points | IPoint[] |
An array of PIXI.Point objects to construct this rope. |
|
textureScale | number | 0 |
By default the rope texture will be stretched to match rope length. If textureScale is positive this value will be treated as a scaling factor and the texture will preserve its aspect ratio instead. To create a tiling rope set baseTexture.wrapMode to PIXI.WRAP_MODES.REPEAT and use a power of two texture, then set textureScale=1 to keep the original texture pixel size. In order to reduce alpha channel artifacts provide a larger texture and downsample - i.e. set textureScale=0.5 to scale it down twice. |
Summary
Properties from RopeGeometry
number |
|
IPoint[] |
An array of points that determine the rope. |
number |
Rope texture scale, if zero then the rope texture is stretched. |
number |
|
Methods from RopeGeometry
void |
refreshes vertices of Rope mesh |
Properties inherited from Geometry
object |
|
number |
|
boolean |
Whether the geometry is instanced. |
number |
Count of existing (not destroyed) meshes that reference this geometry. |
Methods inherited from Geometry
this |
|
PIXI.Geometry |
|
PIXI.Geometry |
|
void |
Destroys the geometry. |
void |
Disposes WebGL resources that are connected to this geometry. |
PIXI.Attribute |
|
PIXI.Buffer |
|
PIXI.Buffer |
|
number |
Get the size of the geometries, in vertices. |
PIXI.Geometry |
|
Public Properties
textureScale: number
Rope texture scale, if zero then the rope texture is stretched.
Public Methods
updateVertices() → {void}
refreshes vertices of Rope mesh
Type | Description |
---|---|
void |