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 protected
-
Cached bounds.
-
_buffer PIXI.Buffer protected inherited
-
Buffer used for position, color, texture IDs
-
_indexBuffer PIXI.Buffer protected inherited
-
Index buffer data
-
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.
-
bounds PIXI.Bounds readonly
-
Get the current bounds of the graphic geometry.
-
The bounds dirty flag.
-
Padding to add to the bounds.
- Default Value:
- 0
-
Used to check if the cache is dirty.
-
Used to detect if we cleared the graphicsData.
- Default Value:
- 0
-
Minimal distance between points that are considered different. Affects line tesselation.
-
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 styleAPIXI.FillStyle | PIXI.LineStyle styleBPIXI.FillStyle | PIXI.LineStyle -
Add colors.
Name Type Description colorsArray.<number> List of colors to add to
colornumber Color to add
alphanumber Alpha to use
sizenumber Number of colors to add
-
Add texture id that the shader/fragment wants to use.
Name Type Description textureIdsArray.<number> idnumber sizenumber -
Generates the UVs for a shape.
Name Type Default Description vertsArray.<number> Vertices
uvsArray.<number> UVs
texturePIXI.Texture Reference to Texture
startnumber Index buffer start index.
sizenumber The size/length for index buffer.
matrixPIXI.Matrix null optional Optional transform for all points.
-
Modify uvs array according to position of texture region Does not work with rotated or trimmed textures
Name Type Description uvsArray.<number> array
texturePIXI.Texture region
startnumber starting index for uvs
sizenumber how many points to adjust
-
Converts intermediate batches data to drawCalls.
-
Update the local bounds of the object. Expensive to use performance-wise.
-
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 pointPIXI.IPointData Point to check if it's contained.
Returns:
Type Description Boolean trueif the point is contained within geometry. -
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 Default Description shapePIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle The shape object to draw.
matrixPIXI.Matrix null 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 Default Description shapePIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle The shape object to draw.
fillStylePIXI.FillStyle null Defines style of the fill.
lineStylePIXI.LineStyle null Defines style of the lines.
matrixPIXI.Matrix null 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.
-
Checks to see if this graphics geometry can be batched. Currently it needs to be small enough and not contain any native lines.
-
Packs attributes to single buffer.
-
Offset the indices so that it works with the batcher.
-
Process fill part of Graphics.
Name Type Description dataPIXI.GraphicsData -
Process the holes data.
Name Type Description holesArray.<PIXI.GraphicsData> Holes to render
-
Process line part of Graphics.
Name Type Description dataPIXI.GraphicsData -
Transform points using matrix.
Name Type Description pointsArray.<number> Points to transform
matrixPIXI.Matrix Transform matrix
-
Generates intermediate batch data. Either gets converted to drawCalls or used to convert to batch objects directly by the Graphics object.
Name Type Description aloow32Indicesboolean optional Allow using 32-bit indices for preventings artefacts when more that 65535 vertices
-
Test geometry for batching process.