PIXI.Graphics
class Graphics extends PIXI.Container
The Graphics class is primarily used to render primitive shapes such as lines, circles and rectangles to the display, and to color and fill them. However, you can also use a Graphics object to build a list of primitives to use as a mask, or as a complex hitArea.
Please note that due to legacy naming conventions, the behavior of some functions in this class
can be confusing. Each call to drawRect()
, drawPolygon()
, etc. actually stores that primitive
in the Geometry class's GraphicsGeometry object for later use in rendering or hit testing - the
functions do not directly draw anything to the screen. Similarly, the clear()
function doesn't
change the screen, it simply resets the list of primitives, which can be useful if you want to
rebuild the contents of an existing Graphics object.
Once a GraphicsGeometry list is built, you can re-use it in other Geometry objects as
an optimization, by passing it into a new Geometry object's constructor. Because of this
ability, it's important to call destroy()
on Geometry objects once you are done with them, to
properly dereference each GraphicsGeometry and prevent memory leaks.
Constructor
new PIXI.Graphics(geometry: PIXI.GraphicsGeometry) → {}
Name | Type | Default | Description |
---|---|---|---|
geometry | PIXI.GraphicsGeometry | undefined |
Geometry to use, if omitted will create a new GraphicsGeometry instance. |
Summary
Properties from Graphics
boolean |
|
PIXI.BLEND_MODES |
|
boolean |
|
PIXI.Polygon |
|
PIXI.FillStyle |
|
PIXI.GraphicsGeometry |
|
PIXI.LineStyle |
|
string |
Renderer plugin for batching |
PIXI.Shader |
|
number |
|
PIXI.FillStyle |
Current fill style. |
boolean |
Current hole mode is enabled. |
PIXI.LineStyle |
Current line style. |
PIXI.Matrix |
Current shape transform matrix. |
number |
Update dirty for limiting calculating batches. |
Array<IGraphicsBatchElement> |
A collections of batches! These can be drawn by the renderer batch system. |
number |
Update dirty for limiting calculating tints for batches. |
Float32Array |
Copy of the object vertex data. |
Methods from Graphics
Properties inherited from Container
T[] |
|
number |
The height of the Container, setting this will actually modify the scale to achieve the value set. |
boolean |
|
boolean |
|
boolean |
Should children be sorted by zIndex at the next updateTransform call. |
number |
The width of the Container, setting this will actually modify the scale to achieve the value set. |
Properties inherited from DisplayObject
boolean |
|
boolean |
|
PIXI.Bounds |
The bounds object, this is used to calculate and store the bounds of the displayObject. |
PIXI.Bounds |
Local bounds object, swapped with |
boolean |
|
boolean |
|
string |
|
string |
|
?string |
|
string |
|
number |
The opacity of the object. |
number |
|
boolean |
|
number |
|
number |
|
boolean |
Should this object be rendered if the bounds of this object are out of frame? |
PIXI.Rectangle |
|
string |
|
boolean |
Readonly flag for destroyed display objects. |
PIXI.Rectangle |
|
PIXI.Filter[] | null |
|
PIXI.IHitArea |
|
boolean |
|
boolean |
Does any other displayObject use this object as a mask? |
boolean |
Used to fast check if a sprite is.. a sprite! |
PIXI.Matrix |
|
PIXI.Container | PIXI.MaskData | null |
|
string |
|
PIXI.Container |
The display object container that contains this display object. |
PIXI.ObservablePoint |
|
PIXI.ObservablePoint |
|
boolean |
|
number |
|
PIXI.ObservablePoint |
The scale factors of this object along the local coordinate axes. |
PIXI.ObservablePoint |
|
PIXI.DisplayObject |
|
PIXI.Transform |
|
boolean |
|
number |
|
PIXI.Matrix |
|
boolean |
|
number |
|
number |
|
number |
The zIndex of the displayObject. |
number |
Flags the cached bounds as dirty. |
PIXI.Rectangle |
Cache of this display-object's bounds-rectangle. |
boolean |
If the object has been destroyed via destroy(). If true, it should not be used. |
PIXI.Filter[] |
|
number |
|
PIXI.Rectangle |
Cache of this display-object's local-bounds rectangle. |
PIXI.Container | PIXI.MaskData |
|
PIXI.Container |
|
number |
|
Methods inherited from Container
Methods inherited from DisplayObject
Inherited Events from Container
Inherited Events from DisplayObject
|
|
|
|
|
|
Capture phase equivalent of |
|
|
|
|
|
Capture phase equivalent of |
|
Fired when the mouse pointer is moved over a DisplayObject and its descendant's hit testing boundaries. |
|
Capture phase equivalent of |
|
Fired when the mouse pointer exits a DisplayObject and its descendants. |
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
Fired when the pointer is moved over a DisplayObject and its descendant's hit testing boundaries. |
|
Capture phase equivalent of |
|
Fired when the pointer leaves the hit testing boundaries of a DisplayObject and its descendants. |
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
|
|
Capture phase equivalent of |
|
PIXI.FederatedWheelEvent |
Fired when a the user scrolls with the mouse cursor over a DisplayObject. |
PIXI.FederatedWheelEvent |
Capture phase equivalent of |
Public Properties
static nextRoundedRectBehavior: boolean = false
New rendering behavior for rounded rectangles: circular arcs instead of quadratic bezier curves. In the next major release, we'll enable this by default.
blendMode: PIXI.BLEND_MODES = PIXI.BLEND_MODES.NORMAL
The blend mode to be applied to the graphic shape. Apply a value of
PIXI.BLEND_MODES.NORMAL
to reset the blend mode. Note that, since each
primitive in the GraphicsGeometry list is rendered sequentially, modes
such as PIXI.BLEND_MODES.ADD
and PIXI.BLEND_MODES.MULTIPLY
will
be applied per-primitive.
cacheAsBitmap: boolean = false
When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. This is not recommended if you are constantly redrawing the graphics element.
geometry: PIXI.GraphicsGeometry
Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU. Can be shared between multiple Mesh or Graphics objects.
shader: PIXI.Shader = undefined
Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. Can be shared between multiple Graphics objects.
tint: number = 0xFFFFFF
The tint applied to each graphic shape. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
Protected Properties
protected batchDirty: number = -1
Update dirty for limiting calculating batches.
protected batches: Array<IGraphicsBatchElement>
A collections of batches! These can be drawn by the renderer batch system.
protected batchTint: number = -1
Update dirty for limiting calculating tints for batches.
protected vertexData: Float32Array = undefined
Copy of the object vertex data.
Public Methods
arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean) → {this}
The arc method creates an arc/curve (used to create circles, or parts of circles).
Name | Type | Default | Description |
---|---|---|---|
cx | number |
The x-coordinate of the center of the circle |
|
cy | number |
The y-coordinate of the center of the circle |
|
radius | number |
The radius of the circle |
|
startAngle | number |
The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) |
|
endAngle | number |
The ending angle, in radians |
|
anticlockwise | boolean | false |
Specifies whether the drawing should be counter-clockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. |
Type | Description |
---|---|
this |
|
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number) → {this}
The arcTo() method creates an arc/curve between two tangents on the canvas.
"borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
Name | Type | Description |
---|---|---|
x1 | number |
The x-coordinate of the first tangent point of the arc |
y1 | number |
The y-coordinate of the first tangent point of the arc |
x2 | number |
The x-coordinate of the end of the arc |
y2 | number |
The y-coordinate of the end of the arc |
radius | number |
The radius of the arc |
Type | Description |
---|---|
this |
|
beginFill(color: number, alpha: number) → {this}
Specifies a simple one-color fill that subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) use when drawing.
Name | Type | Default | Description |
---|---|---|---|
color | number | 0 |
the color of the fill |
alpha | number | 1 |
the alpha of the fill |
Type | Description |
---|---|
this |
|
beginHole() → {this}
Begin adding holes to the last draw shape
IMPORTANT: holes must be fully inside a shape to work
Also weirdness ensues if holes overlap!
Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,
please use moveTo
lineTo
, quadraticCurveTo
if you rely on pixi-legacy bundle.
Type | Description |
---|---|
this |
|
beginTextureFill(options: IFillStyleOptions) → {PIXI.Graphics}
Begin the texture fill
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options | IFillStyleOptions |
<optional> |
Object object. |
|
options.texture | PIXI.Texture |
<optional> |
PIXI.Texture.WHITE |
Texture to fill |
options.color | number |
<optional> |
0xffffff |
Background to fill behind texture |
options.alpha | number |
<optional> |
1 |
Alpha of fill |
options.matrix | PIXI.Matrix |
<optional> |
null |
Transform matrix |
Type | Description |
---|---|
PIXI.Graphics |
This Graphics object. Good for chaining method calls |
bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number) → {this}
Calculate the points for a bezier curve and then draws it.
Name | Type | Description |
---|---|---|
cpX | number |
Control point x |
cpY | number |
Control point y |
cpX2 | number |
Second Control point x |
cpY2 | number |
Second Control point y |
toX | number |
Destination point x |
toY | number |
Destination point y |
Type | Description |
---|---|
this |
This Graphics object. Good for chaining method calls |
clear() → {this}
Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
Type | Description |
---|---|
this |
|
clone() → {PIXI.Graphics}
Creates a new Graphics object with the same values as this one. Note that only the geometry of the object is cloned, not its transform (position,scale,etc)
Type | Description |
---|---|
PIXI.Graphics |
|
closePath() → {this}
Closes the current path.
Type | Description |
---|---|
this |
|
containsPoint(point: IPointData) → {boolean}
Tests if a point is inside this graphics object
Name | Type | Description |
---|---|---|
point | IPointData |
the point to test |
Type | Description |
---|---|
boolean |
|
destroy(options: IDestroyOptions | boolean) → {void}
Destroys the Graphics object.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options | IDestroyOptions | boolean |
<optional> |
Options parameter. A boolean will act as if all options have been set to that value |
|
options.children | boolean |
<optional> |
false |
if set to true, all the children will have their destroy method called as well. 'options' will be passed on to those calls. |
options.texture | boolean |
<optional> |
false |
Only used for child Sprites if options.children is set to true Should it destroy the texture of the child sprite |
options.baseTexture | boolean |
<optional> |
false |
Only used for child Sprites if options.children is set to true Should it destroy the base texture of the child sprite |
Type | Description |
---|---|
void |
drawChamferRect(this: PIXI.Graphics, x: number, y: number, width: number, height: number, chamfer: number) → {PIXI.Graphics}
Draw Rectangle with chamfer corners. These are angled corners.
Note: Only available with @pixi/graphics-extras.
Name | Type | Description |
---|---|---|
this | PIXI.Graphics | |
x | number |
Upper left corner of rect |
y | number |
Upper right corner of rect |
width | number |
Width of rect |
height | number |
Height of rect |
chamfer | number |
non-zero real number, size of corner cutout |
Type | Description |
---|---|
PIXI.Graphics |
Returns self. |
drawCircle(x: number, y: number, radius: number) → {this}
Draws a circle.
Name | Type | Description |
---|---|---|
x | number |
The X coordinate of the center of the circle |
y | number |
The Y coordinate of the center of the circle |
radius | number |
The radius of the circle |
Type | Description |
---|---|
this |
|
drawEllipse(x: number, y: number, width: number, height: number) → {this}
Draws an ellipse.
Name | Type | Description |
---|---|---|
x | number |
The X coordinate of the center of the ellipse |
y | number |
The Y coordinate of the center of the ellipse |
width | number |
The half width of the ellipse |
height | number |
The half height of the ellipse |
Type | Description |
---|---|
this |
|
drawFilletRect(this: PIXI.Graphics, x: number, y: number, width: number, height: number, fillet: number) → {PIXI.Graphics}
Draw Rectangle with fillet corners. This is much like rounded rectangle however it support negative numbers as well for the corner radius.
Note: Only available with @pixi/graphics-extras.
Name | Type | Description |
---|---|---|
this | PIXI.Graphics | |
x | number |
Upper left corner of rect |
y | number |
Upper right corner of rect |
width | number |
Width of rect |
height | number |
Height of rect |
fillet | number |
accept negative or positive values |
Type | Description |
---|---|
PIXI.Graphics |
Returns self. |
drawPolygon(path: Array<number> | Array<PIXI.IPointData> | PIXI.Polygon) → {this}
Draws a polygon using the given path.
Name | Type | Description |
---|---|---|
path | Array<number> | Array<PIXI.IPointData> | PIXI.Polygon |
The path data used to construct the polygon. |
Type | Description |
---|---|
this |
|
drawRect(x: number, y: number, width: number, height: number) → {this}
Draws a rectangle shape.
Name | Type | Description |
---|---|---|
x | number |
The X coord of the top-left of the rectangle |
y | number |
The Y coord of the top-left of the rectangle |
width | number |
The width of the rectangle |
height | number |
The height of the rectangle |
Type | Description |
---|---|
this |
|
drawRegularPolygon(this: PIXI.Graphics, x: number, y: number, radius: number, sides: number, rotation: number) → {PIXI.Graphics}
Draw a regular polygon where all sides are the same length.
Note: Only available with @pixi/graphics-extras.
Name | Type | Default | Description |
---|---|---|---|
this | PIXI.Graphics | ||
x | number |
X position |
|
y | number |
Y position |
|
radius | number |
Polygon radius |
|
sides | number |
Minimum value is 3 |
|
rotation | number | 0 |
Starting rotation values in radians.. |
Type | Description |
---|---|
PIXI.Graphics |
This Graphics object. Good for chaining method calls |
drawRoundedPolygon(this: PIXI.Graphics, x: number, y: number, radius: number, sides: number, corner: number, rotation: number) → {PIXI.Graphics}
Draw a regular polygon with rounded corners.
Note: Only available with @pixi/graphics-extras.
Name | Type | Default | Description |
---|---|---|---|
this | PIXI.Graphics | ||
x | number |
X position |
|
y | number |
Y position |
|
radius | number |
Polygon radius |
|
sides | number |
Minimum value is 3 |
|
corner | number |
Corner size in pixels. |
|
rotation | number | 0 |
Starting rotation values in radians.. |
Type | Description |
---|---|
PIXI.Graphics |
This Graphics object. Good for chaining method calls |
drawRoundedRect(x: number, y: number, width: number, height: number, radius: number) → {this}
Draw a rectangle shape with rounded/beveled corners.
Name | Type | Description |
---|---|---|
x | number |
The X coord of the top-left of the rectangle |
y | number |
The Y coord of the top-left of the rectangle |
width | number |
The width of the rectangle |
height | number |
The height of the rectangle |
radius | number |
Radius of the rectangle corners |
Type | Description |
---|---|
this |
|
drawShape(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle) → {this}
Draw any shape.
Name | Type | Description |
---|---|---|
shape | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle |
Shape to draw |
Type | Description |
---|---|
this |
|
drawStar(this: PIXI.Graphics, x: number, y: number, points: number, radius: number, innerRadius: number, rotation: number) → {PIXI.Graphics}
Draw a star shape with an arbitrary number of points.
Note: Only available with @pixi/graphics-extras.
Name | Type | Default | Description |
---|---|---|---|
this | PIXI.Graphics | ||
x | number |
Center X position of the star |
|
y | number |
Center Y position of the star |
|
points | number |
The number of points of the star, must be > 1 |
|
radius | number |
The outer radius of the star |
|
innerRadius | number |
The inner radius between points, default half |
|
rotation | number | 0 |
The rotation of the star in radians, where 0 is vertical |
Type | Description |
---|---|
PIXI.Graphics |
|
drawTorus(this: PIXI.Graphics, x: number, y: number, innerRadius: number, outerRadius: number, startArc: number, endArc: number) → {PIXI.Graphics}
Draw a torus shape, like a donut. Can be used for something like a circle loader.
Note: Only available with @pixi/graphics-extras.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
this | PIXI.Graphics | |||
x | number |
X position |
||
y | number |
Y position |
||
innerRadius | number |
Inner circle radius |
||
outerRadius | number |
Outer circle radius |
||
startArc | number |
<optional> |
0 |
Where to begin sweep, in radians, 0.0 = to the right |
endArc | number |
<optional> |
Math.PI*2 |
Where to end sweep, in radians |
Type | Description |
---|---|
PIXI.Graphics |
This Graphics object. Good for chaining method calls |
endFill() → {this}
Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
Type | Description |
---|---|
this |
|
endHole() → {this}
End adding holes to the last draw shape.
Type | Description |
---|---|
this |
|
generateCanvasTexture(scaleMode: PIXI.SCALE_MODES, resolution: number) → {PIXI.Texture}
Generates a canvas texture. Only available with pixi.js-legacy bundle or the @pixi/canvas-graphics package.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
scaleMode | PIXI.SCALE_MODES |
<optional> |
The scale mode of the texture. |
|
resolution | number | 1 |
The resolution of the texture. |
Type | Description |
---|---|
PIXI.Texture |
The new texture. |
isFastRect() → {boolean}
True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and masked with gl.scissor.
Type | Description |
---|---|
boolean |
|
lineStyle(width: ILineStyleOptions | number, color: number, alpha: number, alignment: number, native: boolean) → {this}
Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
width | ILineStyleOptions | number |
<optional> |
0 |
width of the line to draw, will update the objects stored style |
color | number |
<optional> |
0x0 |
color of the line to draw, will update the objects stored style |
alpha | number |
<optional> |
1 |
alpha of the line to draw, will update the objects stored style |
alignment | number |
<optional> |
0.5 |
alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer). WebGL only. |
native | boolean |
<optional> |
false |
If true the lines will be draw using LINES instead of TRIANGLE_STRIP |
Type | Description |
---|---|
this |
|
lineStyle(options: ILineStyleOptions) → {PIXI.Graphics}
Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options | ILineStyleOptions |
<optional> |
Line style options |
|
options.width | number |
<optional> |
0 |
width of the line to draw, will update the objects stored style |
options.color | number |
<optional> |
0x0 |
color of the line to draw, will update the objects stored style |
options.alpha | number |
<optional> |
1 |
alpha of the line to draw, will update the objects stored style |
options.alignment | number |
<optional> |
0.5 |
alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer). WebGL only. |
options.native | boolean |
<optional> |
false |
If true the lines will be draw using LINES instead of TRIANGLE_STRIP |
options.cap | PIXI.LINE_CAP |
<optional> |
PIXI.LINE_CAP.BUTT |
line cap style |
options.join | PIXI.LINE_JOIN |
<optional> |
PIXI.LINE_JOIN.MITER |
line join style |
options.miterLimit | number |
<optional> |
10 |
miter limit ratio |
Type | Description |
---|---|
PIXI.Graphics |
This Graphics object. Good for chaining method calls |
lineTextureStyle(options: ILineStyleOptions) → {PIXI.Graphics}
Like line style but support texture for line fill.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options | ILineStyleOptions |
<optional> |
Collection of options for setting line style. |
|
options.width | number |
<optional> |
0 |
width of the line to draw, will update the objects stored style |
options.texture | PIXI.Texture |
<optional> |
PIXI.Texture.WHITE |
Texture to use |
options.color | number |
<optional> |
0x0 |
color of the line to draw, will update the objects stored style. Default 0xFFFFFF if texture present. |
options.alpha | number |
<optional> |
1 |
alpha of the line to draw, will update the objects stored style |
options.matrix | PIXI.Matrix |
<optional> |
null |
Texture matrix to transform texture |
options.alignment | number |
<optional> |
0.5 |
alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer). WebGL only. |
options.native | boolean |
<optional> |
false |
If true the lines will be draw using LINES instead of TRIANGLE_STRIP |
options.cap | PIXI.LINE_CAP |
<optional> |
PIXI.LINE_CAP.BUTT |
line cap style |
options.join | PIXI.LINE_JOIN |
<optional> |
PIXI.LINE_JOIN.MITER |
line join style |
options.miterLimit | number |
<optional> |
10 |
miter limit ratio |
Type | Description |
---|---|
PIXI.Graphics |
This Graphics object. Good for chaining method calls |
lineTo(x: number, y: number) → {this}
Draws a line using the current line style from the current drawing position to (x, y); The current drawing position is then set to (x, y).
Name | Type | Description |
---|---|---|
x | number |
the X coordinate to draw to |
y | number |
the Y coordinate to draw to |
Type | Description |
---|---|
this |
|
moveTo(x: number, y: number) → {this}
Moves the current drawing position to x, y.
Name | Type | Description |
---|---|---|
x | number |
the X coordinate to move to |
y | number |
the Y coordinate to move to |
Type | Description |
---|---|
this |
|
quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number) → {this}
Calculate the points for a quadratic bezier curve and then draws it. Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
Name | Type | Description |
---|---|---|
cpX | number |
Control point x |
cpY | number |
Control point y |
toX | number |
Destination point x |
toY | number |
Destination point y |
Type | Description |
---|---|
this |
|
renderCanvas(renderer: PIXI.CanvasRenderer) → {void}
Renders the object using the Canvas renderer
Name | Type | Description |
---|---|---|
renderer | PIXI.CanvasRenderer |
The renderer |
Type | Description |
---|---|
void |
setMatrix(matrix: PIXI.Matrix) → {this}
Apply a matrix to the positional data.
Name | Type | Description |
---|---|---|
matrix | PIXI.Matrix |
Matrix to use for transform current shape. |
Type | Description |
---|---|
this |
|
Protected Methods
protected _calculateBounds() → {void}
Retrieves the bounds of the graphic shape as a rectangle object.
Type | Description |
---|---|
void |
protected _initCurve(x: number, y: number) → {void}
Initialize the curve
Name | Type | Default | Description |
---|---|---|---|
x | number | 0 | |
y | number | 0 |
Type | Description |
---|---|
void |
protected _populateBatches() → {void}
Populating batches for rendering.
Type | Description |
---|---|
void |
protected _render(renderer: PIXI.Renderer) → {void}
Renders the object using the WebGL renderer
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer |
Type | Description |
---|---|
void |
protected _renderBatched(renderer: PIXI.Renderer) → {void}
Renders the batches using the BathedRenderer plugin
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer |
Type | Description |
---|---|
void |
protected _renderDirect(renderer: PIXI.Renderer) → {void}
Renders the graphics direct
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer |
Type | Description |
---|---|
void |
protected _renderDrawCallDirect(renderer: PIXI.Renderer, drawCall: PIXI.BatchDrawCall) → {void}
Renders specific DrawCall
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer | |
drawCall | PIXI.BatchDrawCall |
Type | Description |
---|---|
void |
protected _resolveDirectShader(renderer: PIXI.Renderer) → {PIXI.Shader}
Resolves shader for direct rendering
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer |
Type | Description |
---|---|
PIXI.Shader |
protected calculateTints() → {void}
Recalculate the tint by applying tint to batches using Graphics tint.
Type | Description |
---|---|
void |
protected calculateVertices() → {void}
If there's a transform update or a change to the shape of the geometry, recalculate the vertices.
Type | Description |
---|---|
void |
protected finishPoly() → {void}
Finish the polygon object.
Type | Description |
---|---|
void |
protected startPoly() → {void}
Start a polygon object internally.
Type | Description |
---|---|
void |