The object to collide with.
When objects are separated from each other.
The object to collide with.
Immediately after performing contact processing between objects.
It will not fire if at least one is "isSensor = true".
The object to collide with.
Immediately before performing contact processing between objects.
It will not fire if at least one is "isSensor = true".
The object to collide with.
The bounds object, this is used to calculate and store the bounds of the displayObject.
Flags the cached bounds as dirty.
Cache of this display-object's bounds-rectangle.
If the object has been destroyed via destroy(). If true, it should not be used.
Currently enabled filters
Which 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.
Local bounds object, swapped with _bounds
when using getLocalBounds()
.
Cache of this display-object's local-bounds rectangle.
The original, cached mask of the object.
The zIndex of the displayObject. A higher value will mean it will be rendered on top of other displayObjects within the same container.
Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set
Setting to false will prevent any children inside this container to be accessible. Defaults to true.
Sets the aria-label attribute of the shadow div
Specify the pointer-events the accessible div will use Defaults to auto.
Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.
The opacity of the object.
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.
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'
.
Set this to true if you want this display object to be cached as a bitmap.
This basically takes a snap shot of the display object as it is at that moment. It can
provide a performance benefit for complex static displayObjects.
To remove simply set this property to false
IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
The array of children of this container.
This defines what cursor mode is used when the mouse cursor is hovered over the displayObject.
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.
Sets the filters for the displayObject.
'null'
.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.
Enable interaction events for the DisplayObject. Touch, pointer and mouse
events will not be emitted unless interactive
is set to true
.
Determines if the children to the displayObject can be clicked/touched
Setting this to false allows PixiJS to bypass a recursive hitTest
function
Does any other displayObject use this object as a mask?
used to fast check if a sprite is.. a sprite!
Current 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
{@link PIXI.Graphics} or a {@link 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.
The instance name of the object.
The display object container that contains this display object.
The pivot point of the displayObject that it rotates around. Assignment by value since pixi-v4.
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.
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.
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.
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 @link 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.
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.
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.
The width of the Container, setting this will actually modify the scale to achieve the value set
The multiplied alpha of the displayObject.
Current transform of the object based on world (parent) factors.
Indicates 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.
Recalculates the bounds of the object. Override this to calculate the bounds of the specific object (not including children).
Recursively updates transform of all objects from the root to this one internal function for toLocal()
To be overridden by the subclasses.
The renderer
Set to perform collision detection with all objects.
Adds one or more children to the container.
Multiple items can be added like so: myContainer.addChild(thingOne, thingTwo, thingThree)
The DisplayObject(s) to add to the container
The first child that was added.
Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
The child to add
The index to place the child in
The child that was added.
Adds the object with the specified "category Bits" to collision detection.
Recalculates the bounds of the container.
Container default updateTransform, does update children of container. Will crash if there's no parent element.
Removes all internal references and listeners as well as removes children from the display list.
Do not use a Container after calling destroy
.
Pair method for enableTempParent
actual parent of element
DisplayObject default updateTransform, does not update children of container. Will crash if there's no parent element.
Calls each of the listeners registered for a given event.
The event name.
Arguments that are passed to registered listeners
true
if the event had listeners, else false
.
Used in Renderer, cacheAsBitmap and other places where you call an updateTransform
on root
const cacheParent = elem.enableTempParent();
elem.updateTransform();
elem.disableTempParent(cacheParent);
current parent
Return an array listing the events for which the emitter has registered listeners.
Retrieves the bounds of the displayObject as a rectangle object.
The rectangular bounding area.
Returns the child at the specified index
The index to get the child at
The child at the given index, if any.
Returns the display object in the container.
Recursive searches are done in a preorder traversal.
Instance name.
The child with the specified name.
Returns the index position of a child DisplayObject instance
The DisplayObject instance to identify
The index position of the child display object to identify
Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
The updated point.
Retrieves the local bounds of the displayObject as a rectangle object.
The rectangular bounding area.
Return the number of listeners listening to a given event.
The event name.
Return the listeners registered for a given event.
The event name.
Overridable method that can be used by Container subclasses whenever the children array is modified
Set not to perform collision detection with any object.
Removes one or more children from the container.
The DisplayObject(s) to remove
The first child that was removed.
Removes a child from the specified index position.
The index to get the child from
The child that was removed.
Removes all children from this container that are within the begin and end indexes.
List of removed children
Removes the object with the specified "category bit" from collision detection.
Renders the object using the WebGL renderer
The renderer
Render the object using the WebGL renderer and advanced features.
The renderer
Changes the position of an existing child in the display object container
The child DisplayObject instance for which you want to change the index number
The resulting index number for the child display object
Set the parent Container of this DisplayObject.
The Container to add this DisplayObject to.
The Container that this DisplayObject was added to.
Convenience function to set the position, scale, skew and pivot at once.
The DisplayObject instance
Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
Swaps the position of 2 Display Objects within this container.
First display object to swap
Second display object to swap
Calculates the global position of the display object.
The world origin to calculate from.
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.
A point object representing the position of this object
Updates the transform on all children of this container for rendering
Mixes all enumerable properties and methods from a source object to DisplayObject.
The source of properties and methods to mix in.
Generated using TypeDoc
When objects come into contact with each other.