Interface: GetGlobalMixin
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:19
Interface for a mixin that provides methods to retrieve global properties of a container. This mixin allows you to get the global alpha, transform matrix, and tint color of a container, taking into account its parent containers and render groups. It includes methods to optimize performance by using cached values when available.
Advanced
Methods
getGlobalAlpha()
> getGlobalAlpha(skipUpdate?): number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:35
Returns the global (compound) alpha of the container within the scene.
Parameters
skipUpdate?
boolean
Performance optimization flag:
- If false (default): Recalculates the entire alpha chain through parents for accuracy
- If true: Uses cached worldAlpha from the last render pass for better performance
Returns
number
The resulting alpha value (between 0 and 1)
Example
// Accurate but slower - recalculates entire alpha chain
const preciseAlpha = container.getGlobalAlpha();
// Faster but may be outdated - uses cached alpha
const cachedAlpha = container.getGlobalAlpha(true);
getGlobalTint()
> getGlobalTint(skipUpdate?): number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:72
Returns the global (compound) tint color of the container within the scene.
Parameters
skipUpdate?
boolean
Performance optimization flag:
- If false (default): Recalculates the entire tint chain through parents for accuracy
- If true: Uses cached worldColor from the last render pass for better performance
Returns
number
The resulting tint color as a 24-bit RGB number (0xRRGGBB)
Example
// Accurate but slower - recalculates entire tint chain
const preciseTint = container.getGlobalTint();
// Faster but may be outdated - uses cached tint
const cachedTint = container.getGlobalTint(true);
getGlobalTransform()
> getGlobalTransform(matrix?, skipUpdate?): Matrix
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:56
Returns the global transform matrix of the container within the scene.
Parameters
matrix?
Optional matrix to store the result. If not provided, a new Matrix will be created.
skipUpdate?
boolean
Performance optimization flag:
- If false (default): Recalculates the entire transform chain for accuracy
- If true: Uses cached worldTransform from the last render pass for better performance
Returns
The resulting transformation matrix (either the input matrix or a new one)
Example
// Accurate but slower - recalculates entire transform chain
const preciseTransform = container.getGlobalTransform();
// Faster but may be outdated - uses cached transform
const cachedTransform = container.getGlobalTransform(undefined, true);
// Reuse existing matrix
const existingMatrix = new Matrix();
container.getGlobalTransform(existingMatrix);