Name | Type | Default | Description |
---|---|---|---|
width |
number | 200 |
optional
The width (i.e., thickness) of the rope. |
points |
Array.<PIXI.Point> |
optional
An array of PIXI.Point objects to construct this rope. |
|
textureScale |
number | 0 |
optional
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. |
Extends
Members
-
glVertexArrayObjects object protected inherited
-
A map of renderer IDs to webgl VAOs
-
instanceCount number inherited
-
Number of instances in this geometry, pass it to
GeometrySystem.draw()
- Default Value:
- 1
-
points Array.<PIXI.Point>
-
An array of points that determine the rope
-
refCount number inherited
-
Count of existing (not destroyed) meshes that reference this geometry
-
Rope texture scale, if zero then the rope texture is stretched.
-
The width (i.e., thickness) of the rope.
Methods
-
addAttribute (id, buffer, size, normalized, type, stride, start)PIXI.Geometry inherited
-
Adds an attribute to the geometry
Name Type Default Description id
String the name of the attribute (matching up to a shader)
buffer
PIXI.Buffer | Array.<number> optional the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
size
Number 0 optional the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
normalized
Boolean false optional should the data be normalized.
type
Number PIXI.TYPES.FLOAT optional what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
stride
Number 0 optional How far apart (in floats) the start of each value is. (used for interleaving data)
start
Number 0 optional How far into the array to start reading values (used for interleaving data)
Returns:
Type Description PIXI.Geometry returns self, useful for chaining. -
addIndex (buffer)PIXI.Geometry inherited
-
Adds an index buffer to the geometry The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
Name Type Description buffer
PIXI.Buffer | Array.<number> optional the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
Returns:
Type Description PIXI.Geometry returns self, useful for chaining. -
clone ()PIXI.Geometry inherited
-
returns a clone of the geometry
Returns:
Type Description PIXI.Geometry a new clone of this geometry -
destroy () inherited
-
Destroys the geometry.
-
dispose () inherited
-
disposes WebGL resources that are connected to this geometry
-
getAttribute (id)PIXI.Attribute inherited
-
returns the requested attribute
Name Type Description id
String the name of the attribute required
Returns:
Type Description PIXI.Attribute the attribute requested. -
getBuffer (id)PIXI.Buffer inherited
-
returns the requested buffer
Name Type Description id
String the name of the buffer required
Returns:
Type Description PIXI.Buffer the buffer requested. -
getIndex ()PIXI.Buffer inherited
-
returns the index buffer
Returns:
Type Description PIXI.Buffer the index buffer. -
interleave ()PIXI.Geometry inherited
-
this function modifies the structure so that all current attributes become interleaved into a single buffer This can be useful if your model remains static as it offers a little performance boost
Returns:
Type Description PIXI.Geometry returns self, useful for chaining. -
refreshes vertices of Rope mesh