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) → {}
Parameters:
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
_width
IPoint[]
points

An array of points that determine the rope.

number
textureScale

Rope texture scale, if zero then the rope texture is stretched.

number
width

Methods from RopeGeometry

void
updateVertices()

refreshes vertices of Rope mesh

Properties inherited from Geometry

object
glVertexArrayObjects
number
instanceCount = 1
boolean
instanced

Whether the geometry is instanced.

number
refCount

Count of existing (not destroyed) meshes that reference this geometry.

Methods inherited from Geometry

this
addAttribute(id: string, buffer: PIXI.Buffer | number<Array>, size: number, normalized: boolean, type: PIXI.TYPES, stride: number, start: number, instance: boolean)
PIXI.Geometry
addIndex(buffer: PIXI.Buffer | number<Array>)
PIXI.Geometry
clone()
void
destroy()

Destroys the geometry.

void
dispose()

Disposes WebGL resources that are connected to this geometry.

PIXI.Attribute
getAttribute(id: string)
PIXI.Buffer
getBuffer(id: string)
PIXI.Buffer
getIndex()
number
getSize()

Get the size of the geometries, in vertices.

PIXI.Geometry
interleave()

Public Properties


_width RopeGeometry.ts:23
_width: number

The width (i.e., thickness) of the rope.

points RopeGeometry.ts:17
points: IPoint[]

An array of points that determine the rope.

textureScale RopeGeometry.ts:20
textureScale: number

Rope texture scale, if zero then the rope texture is stretched.

width RopeGeometry.ts:53
width: number

The width (i.e., thickness) of the rope.

Public Methods


updateVertices RopeGeometry.ts:150
updateVertices() → {void}

refreshes vertices of Rope mesh

Returns:
Type Description
void

Powered by webdoc!