PIXI.DisplayObject#
Needs docs.
PIXI.DisplayObject#
Needs docs.
The bounds object, this is used to calculate and store the bounds of the displayObject.
PIXI.DisplayObject#_bounds
Protected
_boundsIDFlags the cached bounds as dirty.
PIXI.DisplayObject#_boundsID
Protected
_boundsCache of this display-object's bounds-rectangle.
PIXI.DisplayObject#_boundsRect
Private
_createjsProtected
_destroyedIf the object has been destroyed via destroy(). If true, it should not be used.
PIXI.DisplayObject#_destroyed
Protected
_enabledCurrently enabled filters
PIXI.DisplayObject#_enabledFilters
Protected
_fillCurrent fill style
PIXI.Graphics#_fillStyle
Protected
_holeCurrent hole mode is enabled.
PIXI.Graphics#_holeMode
false
@protected
Protected
_lastWhich index in the children array the display component was before the previous zIndex sort. Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
PIXI.DisplayObject#_lastSortedIndex
Protected
_lineCurrent line style
PIXI.Graphics#_lineStyle
Local bounds object, swapped with _bounds
when using getLocalBounds()
.
PIXI.DisplayObject#_localBounds
Protected
_localCache of this display-object's local-bounds rectangle.
PIXI.DisplayObject#_localBoundsRect
Protected
_maskThe original, cached mask of the object.
PIXI.DisplayObject#_mask
Protected
_matrixCurrent shape transform matrix.
PIXI.Graphics#_matrix
Protected
_tempProtected
_zThe zIndex of the displayObject. A higher value will mean it will be rendered on top of other displayObjects within the same container.
PIXI.DisplayObject#_zIndex
Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set
PIXI.DisplayObject#
Setting to false will prevent any children inside this container to be accessible. Defaults to true.
PIXI.DisplayObject#
true
Sets the aria-label attribute of the shadow div
PIXI.DisplayObject#
Specify the pointer-events the accessible div will use Defaults to auto.
PIXI.DisplayObject#
'auto'
Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
PIXI.DisplayObject#
Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.
PIXI.DisplayObject#
'button'
The opacity of the object.
PIXI.DisplayObject#alpha
The angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
Protected
batchUpdate dirty for limiting calculating batches.
PIXI.Graphics#batchDirty
-1
Protected
batchUpdate dirty for limiting calculating tints for batches.
PIXI.Graphics#batchTint
-1
Protected
batchesA collections of batches! These can be drawn by the renderer batch system.
PIXI.Graphics#batches
The blend mode to be applied to the graphic shape. Apply a value of
PIXI.BLEND_MODES.NORMAL
to reset the blend mode.
PIXI.BLEND_MODES.NORMAL;
PIXI.BLEND_MODES
If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
Setting this changes the 'cursor' property to 'pointer'
.
const sprite = new PIXI.Sprite(texture);
sprite.interactive = true;
sprite.buttonMode = true;
PIXI.DisplayObject#
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.
cacheAsBitmap
PIXI.Graphics#
false
Readonly
childrenThe array of children of this container.
PIXI.Container#children
Protected
currentCurrent path
PIXI.Graphics#currentPath
This defines what cursor mode is used when the mouse cursor is hovered over the displayObject.
const sprite = new PIXI.Sprite(texture);
sprite.interactive = true;
sprite.cursor = 'wait';
https://developer.mozilla.org/en/docs/Web/CSS/cursor
PIXI.DisplayObject#
Readonly
fillThe current fill style.
The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
Also works as an interaction mask.
PIXI.DisplayObject#filterArea
Sets the filters for the displayObject.
'null'
.PIXI.DisplayObject#filters
Readonly
geometryIncludes 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.
The height of the Container, setting this will actually modify the scale to achieve the value set
Interaction shape. Children will be hit first, then this shape will be checked. Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
const sprite = new PIXI.Sprite(texture);
sprite.interactive = true;
sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
PIXI.DisplayObject#
Enable interaction events for the DisplayObject. Touch, pointer and mouse
events will not be emitted unless interactive
is set to true
.
const sprite = new PIXI.Sprite(texture);
sprite.interactive = true;
sprite.on('tap', (event) => {
//handle event
});
PIXI.DisplayObject#
Determines if the children to the displayObject can be clicked/touched
Setting this to false allows PixiJS to bypass a recursive hitTest
function
PIXI.Container#
Does any other displayObject use this object as a mask?
PIXI.DisplayObject#isMask
used to fast check if a sprite is.. a sprite!
PIXI.DisplayObject#isSprite
Readonly
lineThe current line style.
Readonly
localCurrent transform of the object based on local factors: position, scale, other stuff.
Sets a mask for the displayObject. A mask is an object that limits the visibility of an
object to the shape of the mask applied to it. In PixiJS a regular mask must be a
PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it
utilities shape clipping. To remove a mask, set this property to null
.
For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
const graphics = new PIXI.Graphics();
graphics.beginFill(0xFF3300);
graphics.drawRect(50, 250, 100, 100);
graphics.endFill();
const sprite = new PIXI.Sprite(texture);
sprite.mask = graphics;
At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
The instance name of the object.
PIXI.DisplayObject#
name
The display object container that contains this display object.
PIXI.DisplayObject#parent
The pivot point of the displayObject that it rotates around. Assignment by value since pixi-v4.
Renderer plugin for batching
PIXI.Graphics#pluginName
'batch'
The coordinate of the object relative to the local coordinates of the parent. Assignment by value since pixi-v4.
Can this object be rendered, if false the object will not be drawn but the updateTransform methods will still be called.
Only affects recursive calls from parent. You can ask for bounds manually.
PIXI.DisplayObject#renderable
The rotation of the object in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
The scale factor of the object. Assignment by value since pixi-v4.
Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. Can be shared between multiple Graphics objects.
PIXI.Graphics#shader
The skew factor for the object in radians. Assignment by value since pixi-v4.
Should children be sorted by zIndex at the next updateTransform call. Will get automatically set to true if a new child is added, or if a child's zIndex changes.
PIXI.Container#sortDirty
If set to true, the container will sort its children by zIndex value when updateTransform() is called, or manually if sortChildren() is called.
This actually changes the order of elements in the array, so should be treated as a basic solution that is not performant compared to other solutions, such as
https://github.com/pixijs/pixi-display
Also be aware of that this may not work nicely with the addChildAt() function, as the zIndex sorting may cause the child to automatically sorted to another position.
PIXI.settings.SORTABLE_CHILDREN
PIXI.Container#sortableChildren
Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g., blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
PIXI.Graphics#state
The tint applied to the graphic shape. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
0xFFFFFF
World transform and local transform of this object. This will become read-only later, please do not assign anything there unless you know what are you doing.
PIXI.DisplayObject#transform
Protected
vertexCopy of the object vertex data.
PIXI.Graphics#vertexData
The visibility of the object. If false the object will not be drawn, and the updateTransform function will not be called.
Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
PIXI.DisplayObject#visible
The width of the Container, setting this will actually modify the scale to achieve the value set
Readonly
worldThe multiplied alpha of the displayObject.
PIXI.DisplayObject#worldAlpha
Readonly
worldCurrent transform of the object based on world (parent) factors.
Readonly
worldIndicates if the object is globally visible.
The position of the displayObject on the x axis relative to the local coordinates of the parent. An alias to position.x
The position of the displayObject on the y axis relative to the local coordinates of the parent. An alias to position.y
The zIndex of the displayObject. If a container has the sortableChildren property set to true, children will be automatically sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, and thus rendered on top of other displayObjects within the same container.
Protected
_calculateProtected
_initProtected
_populateProtected
_renderProtected
_renderProtected
_renderProtected
_resolveAdds one or more children to the container.
Multiple items can be added like so: myContainer.addChild(thingOne, thingTwo, thingThree)
Rest
...children: TChildrenThe DisplayObject(s) to add to the container
The first child that was added.
Optional
context: anyOptional
context: anyThe arc method creates an arc/curve (used to create circles, or parts of circles).
The x-coordinate of the center of the circle
The y-coordinate of the center of the circle
The radius of the circle
The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
The ending angle, in radians
Optional
anticlockwise: booleanSpecifies whether the drawing should be counter-clockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
This Graphics object. Good for chaining method calls
The arcTo() method creates an arc/curve between two tangents on the canvas.
"borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
The x-coordinate of the first tangent point of the arc
The y-coordinate of the first tangent point of the arc
The x-coordinate of the end of the arc
The y-coordinate of the end of the arc
The radius of the arc
This Graphics object. Good for chaining method calls
Specifies a simple one-color fill that subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) use when drawing.
Optional
color: numberthe color of the fill
Optional
alpha: numberthe alpha of the fill
This Graphics object. Good for chaining method calls
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.
Returns itself.
Begin the texture fill
Optional
options: { Object object.
Optional
alpha?: numberAlpha of fill
Optional
color?: numberBackground to fill behind texture
Optional
matrix?: MatrixTransform matrix
Optional
texture?: TextureTexture to fill
This Graphics object. Good for chaining method calls
Calculate the points for a bezier curve and then draws it.
Control point x
Control point y
Second Control point x
Second Control point y
Destination point x
Destination point y
This Graphics object. Good for chaining method calls
Protected
calculateProtected
calculateDestroys the Graphics object.
Optional
options: { Options parameter. A boolean will act as if all options have been set to that value
Optional
baseOnly used for child Sprites if options.children is set to true Should it destroy the base texture of the child sprite
Optional
children?: booleanif set to true, all the children will have their destroy method called as well. 'options' will be passed on to those calls.
Optional
texture?: booleanOnly used for child Sprites if options.children is set to true Should it destroy the texture of the child sprite
Draw Rectangle with chamfer corners.
Note: Only available with @pixi/graphics-extras.
Upper left corner of rect
Upper right corner of rect
Width of rect
Height of rect
accept negative or positive values
Returns self.
PIXI.Graphics#drawChamferRect
Draws an ellipse.
The X coordinate of the center of the ellipse
The Y coordinate of the center of the ellipse
The half width of the ellipse
The half height of the ellipse
This Graphics object. Good for chaining method calls
Draw Rectangle with fillet corners.
Note: Only available with @pixi/graphics-extras.
Upper left corner of rect
Upper right corner of rect
Width of rect
Height of rect
non-zero real number, size of corner cutout
Returns self.
PIXI.Graphics#drawFilletRect
Draws a rectangle shape.
The X coord of the top-left of the rectangle
The Y coord of the top-left of the rectangle
The width of the rectangle
The height of the rectangle
This Graphics object. Good for chaining method calls
Draw a regular polygon where all sides are the same length.
Note: Only available with @pixi/graphics-extras.
X position
Y position
Polygon radius
Minimum value is 3
Starting rotation values in radians..
PIXI.Graphics#drawRegularPolygon
Draw a rectangle shape with rounded/beveled corners.
The X coord of the top-left of the rectangle
The Y coord of the top-left of the rectangle
The width of the rectangle
The height of the rectangle
Radius of the rectangle corners
This Graphics object. Good for chaining method calls
Draw a star shape with an arbitrary number of points.
Center X position of the star
Center Y position of the star
The number of points of the star, must be > 1
The outer radius of the star
Optional
innerRadius: numberThe inner radius between points, default half radius
Optional
rotation: numberThe rotation of the star in radians, where 0 is vertical
This Graphics object. Good for chaining method calls
Draw a torus shape, like a donut. Can be used for something like a circle loader.
Note: Only available with @pixi/graphics-extras.
X position
Y position
Inner circle radius
Outer circle radius
Optional
startArc: numberWhere to begin sweep, in radians, 0.0 = to the right
Optional
endArc: numberWhere to end sweep, in radians
PIXI.Graphics#drawTorus
Protected
finishRetrieves the bounds of the displayObject as a rectangle object.
Optional
skipUpdate: booleanSetting to true
will stop the transforms of the scene graph from
being updated. This means the calculation returned MAY be out of date BUT will give you a
nice performance boost.
Optional
rect: RectangleOptional rectangle to store the result of the bounds calculation.
The rectangular bounding area.
Returns the display object in the container.
Recursive searches are done in a preorder traversal.
Instance name.
Optional
deep: booleanWhether to search recursively
The child with the specified name.
getChildByName
PIXI.Container#
Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
Optional
point: PointThe point to write the global value to.
Optional
skipUpdate: booleanSetting to true will stop the transforms of the scene graph from being updated. This means the calculation returned MAY be out of date BUT will give you a nice performance boost.
The updated point.
getGlobalPosition
PIXI.DisplayObject#
Retrieves the local bounds of the displayObject as a rectangle object.
Optional
rect: RectangleOptional rectangle to store the result of the bounds calculation.
Optional
skipChildrenUpdate: booleanSetting to true
will stop re-calculation of children transforms,
it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
The rectangular bounding area.
Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
Optional
width: numberwidth of the line to draw, will update the objects stored style
Optional
color: numbercolor of the line to draw, will update the objects stored style
Optional
alpha: numberalpha of the line to draw, will update the objects stored style
Optional
alignment: numberalignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
Optional
native: booleanIf true the lines will be draw using LINES instead of TRIANGLE_STRIP
This Graphics object. Good for chaining method calls
PIXI.Graphics#lineStyle
Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
Optional
width: numberwidth of the line to draw, will update the objects stored style
Optional
color: numbercolor of the line to draw, will update the objects stored style
Optional
alpha: numberalpha of the line to draw, will update the objects stored style
Optional
alignment: numberalignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
Optional
native: booleanIf true the lines will be draw using LINES instead of TRIANGLE_STRIP
This Graphics object. Good for chaining method calls
PIXI.Graphics#lineStyle
Like line style but support texture for line fill.
Optional
options: { Collection of options for setting line style.
Optional
alignment?: numberalignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
Optional
alpha?: numberalpha of the line to draw, will update the objects stored style
Optional
cap?: LINE_CAPline cap style
Optional
color?: numbercolor of the line to draw, will update the objects stored style. Default 0xFFFFFF if texture present.
Optional
join?: LINE_JOINline join style
Optional
matrix?: MatrixTexture matrix to transform texture
Optional
mitermiter limit ratio
Optional
native?: booleanIf true the lines will be draw using LINES instead of TRIANGLE_STRIP
Optional
texture?: TextureTexture to use
Optional
width?: numberwidth of the line to draw, will update the objects stored style
This Graphics object. Good for chaining method calls
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).
the X coordinate to draw to
the Y coordinate to draw to
This Graphics object. Good for chaining method calls
Protected
onCalculate 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
Control point x
Control point y
Destination point x
Destination point y
This Graphics object. Good for chaining method calls
Removes all children from this container that are within the begin and end indexes.
Optional
beginIndex: numberThe beginning position.
Optional
endIndex: numberThe ending position. Default value is size of the container.
List of removed children
Optional
fn: ((event) => void)Optional
context: anyOptional
fn: FunctionOptional
context: anyProtected
renderConvenience function to set the position, scale, skew and pivot at once.
Optional
x: numberThe X position
Optional
y: numberThe Y position
Optional
scaleX: numberThe X scale value
Optional
scaleY: numberThe Y scale value
Optional
rotation: numberThe rotation
Optional
skewX: numberThe X skew value
Optional
skewY: numberThe Y skew value
Optional
pivotX: numberThe X pivot value
Optional
pivotY: numberThe Y pivot value
The DisplayObject instance
Protected
startCalculates the global position of the display object.
The world origin to calculate from.
Optional
point: PointA Point object in which to store the value, optional (otherwise will create a new Point).
Optional
skipUpdate: booleanShould we skip the update transform.
A point object representing the position of this object.
Calculates the local position of the display object relative to another point.
The world origin to calculate from.
Optional
from: DisplayObjectThe DisplayObject to calculate the global position from.
Optional
point: PointA Point object in which to store the value, optional (otherwise will create a new Point).
Optional
skipUpdate: booleanShould we skip the update transform
A point object representing the position of this object
Static
mixinGenerated using TypeDoc
inherited PIXI.Graphics