Extends
Members
The maximum number of points to consider an object "batchable", able to be batched by the renderer's batch system.
- Default Value:
- 100
bounds PIXI.Bounds
Get the current bounds of the graphic geometry.
Padding to add to the bounds.
- Default Value:
- 0
Minimal distance between points that are considered different. Affects line tesselation.
_bounds PIXI.Bounds protected
Cached bounds.
Batches need to regenerated if the geometry is updated.
batches Array<PIXI.graphicsUtils.BatchPart> protected
Intermediate abstract format sent to batch system. Can be converted to drawCalls or to batchable objects.
The bounds dirty flag.
Used to check if the cache is dirty.
Used to detect if we cleared the graphicsData.
- Default Value:
- 0
The collection of colors
Used to detect if the graphics object has changed.
List of current draw calls drived from the batches.
graphicsData Array<PIXI.GraphicsData> protected
The collection of drawn shapes.
The indices of the vertices
An array of points to draw, 2 numbers per point
Index of the last batched shape in the stack of calls.
Reference to the texture IDs.
The UVs collection
Methods
Affinity check
Name | Type | Description |
---|---|---|
styleA |
PIXI.FillStyle | PIXI.LineStyle | |
styleB |
PIXI.FillStyle | PIXI.LineStyle |
Returns:
Type | Description |
---|---|
boolean |
Modify uvs array according to position of texture region Does not work with rotated or trimmed textures
Name | Type | Description |
---|---|---|
uvs |
Array |
array |
texture |
PIXI.Texture |
region |
start |
number |
starting index for uvs |
size |
number |
how many points to adjust |
Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
Returns:
Type | Description |
---|---|
PIXI.GraphicsGeometry | This GraphicsGeometry object. Good for chaining method calls |
Check to see if a point is contained within this geometry.
Name | Type | Description |
---|---|---|
point |
PIXI.IPointData |
Point to check if it's contained. |
Returns:
Type | Description |
---|---|
Boolean | true if the point is contained within geometry. |
destroy () void overrides
Destroys the GraphicsGeometry object.
drawHole (shape, matrix) PIXI.GraphicsGeometry
Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
Name | Type | Description |
---|---|---|
shape |
PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle |
The shape object to draw. |
matrix |
PIXI.Matrix |
Transform applied to the points of the shape. |
Returns:
Type | Description |
---|---|
PIXI.GraphicsGeometry | Returns geometry for chaining. |
drawShape (shape, fillStyle, lineStyle, matrix) PIXI.GraphicsGeometry
Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
Name | Type | Description |
---|---|---|
shape |
PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle |
The shape object to draw. |
fillStyle |
PIXI.FillStyle |
Defines style of the fill. |
lineStyle |
PIXI.LineStyle |
Defines style of the lines. |
matrix |
PIXI.Matrix |
Transform applied to the points of the shape. |
Returns:
Type | Description |
---|---|
PIXI.GraphicsGeometry | Returns geometry for chaining. |
Call if you changed graphicsData manually. Empties all batch buffers.
Generates intermediate batch data. Either gets converted to drawCalls or used to convert to batch objects directly by the Graphics object.
Name | Type | Attributes | Description |
---|---|---|---|
aloow32Indices |
boolean |
<optional> |
Allow using 32-bit indices for preventings artefacts when more that 65535 vertices |
Add colors.
Name | Type | Description |
---|---|---|
colors |
Array |
List of colors to add to |
color |
number |
Color to add |
alpha |
number |
Alpha to use |
size |
number |
Number of colors to add |
Add texture id that the shader/fragment wants to use.
Name | Type | Description |
---|---|---|
textureIds |
Array |
|
id |
number | |
size |
number |
Generates the UVs for a shape.
Name | Type | Attributes | Description |
---|---|---|---|
verts |
Array |
Vertices |
|
uvs |
Array |
UVs |
|
texture |
PIXI.Texture |
Reference to Texture |
|
start |
number |
Index buffer start index. |
|
size |
number |
The size/length for index buffer. |
|
matrix |
PIXI.Matrix |
<optional> |
Optional transform for all points. |
Converts intermediate batches data to drawCalls.
Update the local bounds of the object. Expensive to use performance-wise.
Checks to see if this graphics geometry can be batched. Currently it needs to be small enough and not contain any native lines.
Returns:
Type | Description |
---|---|
boolean |
Packs attributes to single buffer.
Offset the indices so that it works with the batcher.
Process fill part of Graphics.
Name | Type | Description |
---|---|---|
data |
PIXI.GraphicsData |
Process the holes data.
Name | Type | Description |
---|---|---|
holes |
Array<PIXI.GraphicsData> |
Holes to render |
Process line part of Graphics.
Name | Type | Description |
---|---|---|
data |
PIXI.GraphicsData |
Transform points using matrix.
Name | Type | Description |
---|---|---|
points |
Array |
Points to transform |
matrix |
PIXI.Matrix |
Transform matrix |
Test geometry for batching process.
Returns:
Type | Description |
---|---|
boolean |
Inherited Properties
From class PIXI.BatchGeometry
_buffer PIXI.Buffer protected inherited
Buffer used for position, color, texture IDs
_indexBuffer PIXI.Buffer protected inherited
Index buffer data
From class PIXI.Geometry
instanceCount number inherited
Number of instances in this geometry, pass it to GeometrySystem.draw()
- Default Value:
- 1
refCount number inherited
Count of existing (not destroyed) meshes that reference this geometry
glVertexArrayObjects object protected inherited
A map of renderer IDs to webgl VAOs
Inherited Methods
From class PIXI.Geometry
addAttribute (id, buffer, size, normalized, type, stride, start, instance) PIXI.Geometry inherited
Adds an attribute to the geometry
Note: stride
and start
should be undefined
if you dont know them, not 0!
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
String |
the name of the attribute (matching up to a shader) |
||
buffer |
PIXI.Buffer | 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 |
<optional> |
0 |
the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2 |
normalized |
Boolean |
<optional> |
false |
should the data be normalized. |
type |
Number |
<optional> |
PIXI.TYPES.FLOAT |
what type of number is the attribute. Check {PIXI.TYPES} to see the ones available |
stride |
Number |
<optional> |
How far apart (in floats) the start of each value is. (used for interleaving data) |
|
start |
Number |
<optional> |
How far into the array to start reading values (used for interleaving data) |
|
instance |
boolean |
<optional> |
false |
Instancing flag |
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 | Attributes | Description |
---|---|---|---|
buffer |
PIXI.Buffer | 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 |
dispose () void 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. |