Batches need to regenerated if the geometry is updated.
Intermediate abstract format sent to batch system. Can be converted to drawCalls or to batchable objects.
Padding to add to the bounds.
Minimal distance between points that are considered different. Affects line tesselation.
The collection of colors
List of current draw calls drived from the batches.
A map of renderer IDs to webgl VAOs
The collection of drawn shapes.
The indices of the vertices
Number of instances in this geometry, pass it to GeometrySystem.draw()
.
1
Whether the geometry is instanced.
An array of points to draw, 2 numbers per point
Count of existing (not destroyed) meshes that reference this geometry.
Reference to the texture IDs.
The UVs collection
Static
BATCHABLE_The maximum number of points to consider an object "batchable", able to be batched by the renderer's batch system.
Get the current bounds of the graphic geometry.
Since 6.5.0, bounds of the graphics geometry are calculated based on the vertices of generated geometry.
Since shapes or strokes with full transparency (alpha: 0
) will not generate geometry, they are not considered
when calculating bounds for the graphics geometry. See PR [#8343]https://github.com/pixijs/pixijs/pull/8343
and issue [#8623]https://github.com/pixijs/pixijs/pull/8623.
Adds an attribute to the geometry
Note: stride
and start
should be undefined
if you dont know them, not 0!
the name of the attribute (matching up to a shader)
the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
Optional
size: numberthe size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
Optional
normalized: booleanshould the data be normalized.
Optional
type: TYPESwhat type of number is the attribute. Check PIXI.TYPES to see the ones available
Optional
stride: numberHow far apart, in bytes, the start of each value is. (used for interleaving data)
Optional
start: numberHow far into the array to start reading values (used for interleaving data)
Optional
instance: booleanInstancing flag
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.
Optional
buffer: number[] | IArrayBuffer | BufferThe buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
Check to see if a point is contained within this geometry.
Point to check if it's contained.
true
if the point is contained within geometry.
Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
Static
mergeGenerated using TypeDoc
The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and to color and fill them.
GraphicsGeometry is designed to not be continually updating the geometry since it's expensive to re-tesselate using earcut. Consider using PIXI.Mesh for this use-case, it's much faster.
Memberof
PIXI