sdfsdfs
This commit is contained in:
17
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts
generated
vendored
Normal file
17
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { Container, ContainerChild } from '../Container';
|
||||
export interface ChildrenHelperMixin<C = ContainerChild> {
|
||||
allowChildren: boolean;
|
||||
addChild<U extends C[]>(...children: U): U[0];
|
||||
removeChild<U extends C[]>(...children: U): U[0];
|
||||
removeChildren(beginIndex?: number, endIndex?: number): C[];
|
||||
removeChildAt<U extends C>(index: number): U;
|
||||
getChildAt<U extends C>(index: number): U;
|
||||
setChildIndex(child: C, index: number): void;
|
||||
getChildIndex(child: C): number;
|
||||
addChildAt<U extends C>(child: U, index: number): U;
|
||||
swapChildren<U extends C>(child: U, child2: U): void;
|
||||
removeFromParent(): void;
|
||||
reparentChild<U extends C[]>(...child: U): U[0];
|
||||
reparentChildAt<U extends C>(child: U, index: number): U;
|
||||
}
|
||||
export declare const childrenHelperMixin: Partial<Container>;
|
197
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.js
generated
vendored
Normal file
197
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
'use strict';
|
||||
|
||||
var removeItems = require('../../../utils/data/removeItems.js');
|
||||
var deprecation = require('../../../utils/logging/deprecation.js');
|
||||
|
||||
"use strict";
|
||||
const childrenHelperMixin = {
|
||||
allowChildren: true,
|
||||
/**
|
||||
* Removes all children from this container that are within the begin and end indexes.
|
||||
* @param beginIndex - The beginning position.
|
||||
* @param endIndex - The ending position. Default value is size of the container.
|
||||
* @returns - List of removed children
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
removeChildren(beginIndex = 0, endIndex) {
|
||||
const end = endIndex ?? this.children.length;
|
||||
const range = end - beginIndex;
|
||||
const removed = [];
|
||||
if (range > 0 && range <= end) {
|
||||
for (let i = end - 1; i >= beginIndex; i--) {
|
||||
const child = this.children[i];
|
||||
if (!child)
|
||||
continue;
|
||||
removed.push(child);
|
||||
child.parent = null;
|
||||
}
|
||||
removeItems.removeItems(this.children, beginIndex, end);
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.removeChildren(removed);
|
||||
}
|
||||
for (let i = 0; i < removed.length; ++i) {
|
||||
this.emit("childRemoved", removed[i], this, i);
|
||||
removed[i].emit("removed", this);
|
||||
}
|
||||
return removed;
|
||||
} else if (range === 0 && this.children.length === 0) {
|
||||
return removed;
|
||||
}
|
||||
throw new RangeError("removeChildren: numeric values are outside the acceptable range.");
|
||||
},
|
||||
/**
|
||||
* Removes a child from the specified index position.
|
||||
* @param index - The index to get the child from
|
||||
* @returns The child that was removed.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
removeChildAt(index) {
|
||||
const child = this.getChildAt(index);
|
||||
return this.removeChild(child);
|
||||
},
|
||||
/**
|
||||
* Returns the child at the specified index
|
||||
* @param index - The index to get the child at
|
||||
* @returns - The child at the given index, if any.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getChildAt(index) {
|
||||
if (index < 0 || index >= this.children.length) {
|
||||
throw new Error(`getChildAt: Index (${index}) does not exist.`);
|
||||
}
|
||||
return this.children[index];
|
||||
},
|
||||
/**
|
||||
* Changes the position of an existing child in the container container
|
||||
* @param child - The child Container instance for which you want to change the index number
|
||||
* @param index - The resulting index number for the child container
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
setChildIndex(child, index) {
|
||||
if (index < 0 || index >= this.children.length) {
|
||||
throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);
|
||||
}
|
||||
this.getChildIndex(child);
|
||||
this.addChildAt(child, index);
|
||||
},
|
||||
/**
|
||||
* Returns the index position of a child Container instance
|
||||
* @param child - The Container instance to identify
|
||||
* @returns - The index position of the child container to identify
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getChildIndex(child) {
|
||||
const index = this.children.indexOf(child);
|
||||
if (index === -1) {
|
||||
throw new Error("The supplied Container must be a child of the caller");
|
||||
}
|
||||
return index;
|
||||
},
|
||||
/**
|
||||
* Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown.
|
||||
* If the child is already in this container, it will be moved to the specified index.
|
||||
* @param {Container} child - The child to add.
|
||||
* @param {number} index - The absolute index where the child will be positioned at the end of the operation.
|
||||
* @returns {Container} The child that was added.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
addChildAt(child, index) {
|
||||
if (!this.allowChildren) {
|
||||
deprecation.deprecation(deprecation.v8_0_0, "addChildAt: Only Containers will be allowed to add children in v8.0.0");
|
||||
}
|
||||
const { children } = this;
|
||||
if (index < 0 || index > children.length) {
|
||||
throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${children.length}`);
|
||||
}
|
||||
if (child.parent) {
|
||||
const currentIndex = child.parent.children.indexOf(child);
|
||||
if (child.parent === this && currentIndex === index) {
|
||||
return child;
|
||||
}
|
||||
if (currentIndex !== -1) {
|
||||
child.parent.children.splice(currentIndex, 1);
|
||||
}
|
||||
}
|
||||
if (index === children.length) {
|
||||
children.push(child);
|
||||
} else {
|
||||
children.splice(index, 0, child);
|
||||
}
|
||||
child.parent = this;
|
||||
child.didChange = true;
|
||||
child.didViewUpdate = false;
|
||||
child._updateFlags = 15;
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.addChild(child);
|
||||
}
|
||||
if (this.sortableChildren)
|
||||
this.sortDirty = true;
|
||||
this.emit("childAdded", child, this, index);
|
||||
child.emit("added", this);
|
||||
return child;
|
||||
},
|
||||
/**
|
||||
* Swaps the position of 2 Containers within this container.
|
||||
* @param child - First container to swap
|
||||
* @param child2 - Second container to swap
|
||||
*/
|
||||
swapChildren(child, child2) {
|
||||
if (child === child2) {
|
||||
return;
|
||||
}
|
||||
const index1 = this.getChildIndex(child);
|
||||
const index2 = this.getChildIndex(child2);
|
||||
this.children[index1] = child2;
|
||||
this.children[index2] = child;
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.structureDidChange = true;
|
||||
}
|
||||
this._didContainerChangeTick++;
|
||||
},
|
||||
/**
|
||||
* Remove the Container from its parent Container. If the Container has no parent, do nothing.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
removeFromParent() {
|
||||
this.parent?.removeChild(this);
|
||||
},
|
||||
/**
|
||||
* Reparent the child to this container, keeping the same worldTransform.
|
||||
* @param child - The child to reparent
|
||||
* @returns The first child that was reparented.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
reparentChild(...child) {
|
||||
if (child.length === 1) {
|
||||
return this.reparentChildAt(child[0], this.children.length);
|
||||
}
|
||||
child.forEach((c) => this.reparentChildAt(c, this.children.length));
|
||||
return child[0];
|
||||
},
|
||||
/**
|
||||
* Reparent the child to this container at the specified index, keeping the same worldTransform.
|
||||
* @param child - The child to reparent
|
||||
* @param index - The index to reparent the child to
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
reparentChildAt(child, index) {
|
||||
if (child.parent === this) {
|
||||
this.setChildIndex(child, index);
|
||||
return child;
|
||||
}
|
||||
const childMat = child.worldTransform.clone();
|
||||
child.removeFromParent();
|
||||
this.addChildAt(child, index);
|
||||
const newMatrix = this.worldTransform.clone();
|
||||
newMatrix.invert();
|
||||
childMat.prepend(newMatrix);
|
||||
child.setFromMatrix(childMat);
|
||||
return child;
|
||||
}
|
||||
};
|
||||
|
||||
exports.childrenHelperMixin = childrenHelperMixin;
|
||||
//# sourceMappingURL=childrenHelperMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
195
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.mjs
generated
vendored
Normal file
195
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
import { removeItems } from '../../../utils/data/removeItems.mjs';
|
||||
import { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';
|
||||
|
||||
"use strict";
|
||||
const childrenHelperMixin = {
|
||||
allowChildren: true,
|
||||
/**
|
||||
* Removes all children from this container that are within the begin and end indexes.
|
||||
* @param beginIndex - The beginning position.
|
||||
* @param endIndex - The ending position. Default value is size of the container.
|
||||
* @returns - List of removed children
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
removeChildren(beginIndex = 0, endIndex) {
|
||||
const end = endIndex ?? this.children.length;
|
||||
const range = end - beginIndex;
|
||||
const removed = [];
|
||||
if (range > 0 && range <= end) {
|
||||
for (let i = end - 1; i >= beginIndex; i--) {
|
||||
const child = this.children[i];
|
||||
if (!child)
|
||||
continue;
|
||||
removed.push(child);
|
||||
child.parent = null;
|
||||
}
|
||||
removeItems(this.children, beginIndex, end);
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.removeChildren(removed);
|
||||
}
|
||||
for (let i = 0; i < removed.length; ++i) {
|
||||
this.emit("childRemoved", removed[i], this, i);
|
||||
removed[i].emit("removed", this);
|
||||
}
|
||||
return removed;
|
||||
} else if (range === 0 && this.children.length === 0) {
|
||||
return removed;
|
||||
}
|
||||
throw new RangeError("removeChildren: numeric values are outside the acceptable range.");
|
||||
},
|
||||
/**
|
||||
* Removes a child from the specified index position.
|
||||
* @param index - The index to get the child from
|
||||
* @returns The child that was removed.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
removeChildAt(index) {
|
||||
const child = this.getChildAt(index);
|
||||
return this.removeChild(child);
|
||||
},
|
||||
/**
|
||||
* Returns the child at the specified index
|
||||
* @param index - The index to get the child at
|
||||
* @returns - The child at the given index, if any.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getChildAt(index) {
|
||||
if (index < 0 || index >= this.children.length) {
|
||||
throw new Error(`getChildAt: Index (${index}) does not exist.`);
|
||||
}
|
||||
return this.children[index];
|
||||
},
|
||||
/**
|
||||
* Changes the position of an existing child in the container container
|
||||
* @param child - The child Container instance for which you want to change the index number
|
||||
* @param index - The resulting index number for the child container
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
setChildIndex(child, index) {
|
||||
if (index < 0 || index >= this.children.length) {
|
||||
throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);
|
||||
}
|
||||
this.getChildIndex(child);
|
||||
this.addChildAt(child, index);
|
||||
},
|
||||
/**
|
||||
* Returns the index position of a child Container instance
|
||||
* @param child - The Container instance to identify
|
||||
* @returns - The index position of the child container to identify
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getChildIndex(child) {
|
||||
const index = this.children.indexOf(child);
|
||||
if (index === -1) {
|
||||
throw new Error("The supplied Container must be a child of the caller");
|
||||
}
|
||||
return index;
|
||||
},
|
||||
/**
|
||||
* Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown.
|
||||
* If the child is already in this container, it will be moved to the specified index.
|
||||
* @param {Container} child - The child to add.
|
||||
* @param {number} index - The absolute index where the child will be positioned at the end of the operation.
|
||||
* @returns {Container} The child that was added.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
addChildAt(child, index) {
|
||||
if (!this.allowChildren) {
|
||||
deprecation(v8_0_0, "addChildAt: Only Containers will be allowed to add children in v8.0.0");
|
||||
}
|
||||
const { children } = this;
|
||||
if (index < 0 || index > children.length) {
|
||||
throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${children.length}`);
|
||||
}
|
||||
if (child.parent) {
|
||||
const currentIndex = child.parent.children.indexOf(child);
|
||||
if (child.parent === this && currentIndex === index) {
|
||||
return child;
|
||||
}
|
||||
if (currentIndex !== -1) {
|
||||
child.parent.children.splice(currentIndex, 1);
|
||||
}
|
||||
}
|
||||
if (index === children.length) {
|
||||
children.push(child);
|
||||
} else {
|
||||
children.splice(index, 0, child);
|
||||
}
|
||||
child.parent = this;
|
||||
child.didChange = true;
|
||||
child.didViewUpdate = false;
|
||||
child._updateFlags = 15;
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.addChild(child);
|
||||
}
|
||||
if (this.sortableChildren)
|
||||
this.sortDirty = true;
|
||||
this.emit("childAdded", child, this, index);
|
||||
child.emit("added", this);
|
||||
return child;
|
||||
},
|
||||
/**
|
||||
* Swaps the position of 2 Containers within this container.
|
||||
* @param child - First container to swap
|
||||
* @param child2 - Second container to swap
|
||||
*/
|
||||
swapChildren(child, child2) {
|
||||
if (child === child2) {
|
||||
return;
|
||||
}
|
||||
const index1 = this.getChildIndex(child);
|
||||
const index2 = this.getChildIndex(child2);
|
||||
this.children[index1] = child2;
|
||||
this.children[index2] = child;
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.structureDidChange = true;
|
||||
}
|
||||
this._didContainerChangeTick++;
|
||||
},
|
||||
/**
|
||||
* Remove the Container from its parent Container. If the Container has no parent, do nothing.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
removeFromParent() {
|
||||
this.parent?.removeChild(this);
|
||||
},
|
||||
/**
|
||||
* Reparent the child to this container, keeping the same worldTransform.
|
||||
* @param child - The child to reparent
|
||||
* @returns The first child that was reparented.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
reparentChild(...child) {
|
||||
if (child.length === 1) {
|
||||
return this.reparentChildAt(child[0], this.children.length);
|
||||
}
|
||||
child.forEach((c) => this.reparentChildAt(c, this.children.length));
|
||||
return child[0];
|
||||
},
|
||||
/**
|
||||
* Reparent the child to this container at the specified index, keeping the same worldTransform.
|
||||
* @param child - The child to reparent
|
||||
* @param index - The index to reparent the child to
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
reparentChildAt(child, index) {
|
||||
if (child.parent === this) {
|
||||
this.setChildIndex(child, index);
|
||||
return child;
|
||||
}
|
||||
const childMat = child.worldTransform.clone();
|
||||
child.removeFromParent();
|
||||
this.addChildAt(child, index);
|
||||
const newMatrix = this.worldTransform.clone();
|
||||
newMatrix.invert();
|
||||
childMat.prepend(newMatrix);
|
||||
child.setFromMatrix(childMat);
|
||||
return child;
|
||||
}
|
||||
};
|
||||
|
||||
export { childrenHelperMixin };
|
||||
//# sourceMappingURL=childrenHelperMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts
generated
vendored
Normal file
19
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { FilterEffect } from '../../../filters/FilterEffect';
|
||||
import type { Filter } from '../../../filters/Filter';
|
||||
import type { Rectangle } from '../../../maths/shapes/Rectangle';
|
||||
import type { MaskEffect } from '../../../rendering/mask/MaskEffectManager';
|
||||
import type { Container } from '../Container';
|
||||
import type { Effect } from '../Effect';
|
||||
export interface EffectsMixinConstructor {
|
||||
mask?: number | Container | null;
|
||||
filters?: Filter | Filter[];
|
||||
}
|
||||
export interface EffectsMixin extends Required<EffectsMixinConstructor> {
|
||||
_maskEffect?: MaskEffect;
|
||||
_filterEffect?: FilterEffect;
|
||||
filterArea?: Rectangle;
|
||||
effects?: Effect[];
|
||||
addEffect(effect: Effect): void;
|
||||
removeEffect(effect: Effect): void;
|
||||
}
|
||||
export declare const effectsMixin: Partial<Container>;
|
133
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.js
generated
vendored
Normal file
133
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
'use strict';
|
||||
|
||||
var FilterEffect = require('../../../filters/FilterEffect.js');
|
||||
var MaskEffectManager = require('../../../rendering/mask/MaskEffectManager.js');
|
||||
|
||||
"use strict";
|
||||
const effectsMixin = {
|
||||
_maskEffect: null,
|
||||
_filterEffect: null,
|
||||
/**
|
||||
* @todo Needs docs.
|
||||
* @memberof scene.Container#
|
||||
* @type {Array<Effect>}
|
||||
*/
|
||||
effects: [],
|
||||
/**
|
||||
* @todo Needs docs.
|
||||
* @param effect - The effect to add.
|
||||
* @memberof scene.Container#
|
||||
* @ignore
|
||||
*/
|
||||
addEffect(effect) {
|
||||
const index = this.effects.indexOf(effect);
|
||||
if (index !== -1)
|
||||
return;
|
||||
this.effects.push(effect);
|
||||
this.effects.sort((a, b) => a.priority - b.priority);
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.structureDidChange = true;
|
||||
}
|
||||
this._updateIsSimple();
|
||||
},
|
||||
/**
|
||||
* @todo Needs docs.
|
||||
* @param effect - The effect to remove.
|
||||
* @memberof scene.Container#
|
||||
* @ignore
|
||||
*/
|
||||
removeEffect(effect) {
|
||||
const index = this.effects.indexOf(effect);
|
||||
if (index === -1)
|
||||
return;
|
||||
this.effects.splice(index, 1);
|
||||
if (this.parentRenderGroup) {
|
||||
this.parentRenderGroup.structureDidChange = true;
|
||||
}
|
||||
this._updateIsSimple();
|
||||
},
|
||||
set mask(value) {
|
||||
const effect = this._maskEffect;
|
||||
if (effect?.mask === value)
|
||||
return;
|
||||
if (effect) {
|
||||
this.removeEffect(effect);
|
||||
MaskEffectManager.MaskEffectManager.returnMaskEffect(effect);
|
||||
this._maskEffect = null;
|
||||
}
|
||||
if (value === null || value === void 0)
|
||||
return;
|
||||
this._maskEffect = MaskEffectManager.MaskEffectManager.getMaskEffect(value);
|
||||
this.addEffect(this._maskEffect);
|
||||
},
|
||||
/**
|
||||
* 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 Graphics} or a {@link Sprite} object. This allows for much faster masking in canvas as it
|
||||
* utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent.
|
||||
* Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong.
|
||||
* 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.
|
||||
* @example
|
||||
* import { Graphics, Sprite } from 'pixi.js';
|
||||
*
|
||||
* const graphics = new Graphics();
|
||||
* graphics.beginFill(0xFF3300);
|
||||
* graphics.drawRect(50, 250, 100, 100);
|
||||
* graphics.endFill();
|
||||
*
|
||||
* const sprite = new Sprite(texture);
|
||||
* sprite.mask = graphics;
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get mask() {
|
||||
return this._maskEffect?.mask;
|
||||
},
|
||||
set filters(value) {
|
||||
if (!Array.isArray(value) && value)
|
||||
value = [value];
|
||||
const effect = this._filterEffect || (this._filterEffect = new FilterEffect.FilterEffect());
|
||||
value = value;
|
||||
const hasFilters = value?.length > 0;
|
||||
const hadFilters = effect.filters?.length > 0;
|
||||
const didChange = hasFilters !== hadFilters;
|
||||
value = Array.isArray(value) ? value.slice(0) : value;
|
||||
effect.filters = Object.freeze(value);
|
||||
if (didChange) {
|
||||
if (hasFilters) {
|
||||
this.addEffect(effect);
|
||||
} else {
|
||||
this.removeEffect(effect);
|
||||
effect.filters = value ?? null;
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Sets the filters for the displayObject.
|
||||
* IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
|
||||
* To remove filters simply set this property to `'null'`.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get filters() {
|
||||
return this._filterEffect?.filters;
|
||||
},
|
||||
set filterArea(value) {
|
||||
this._filterEffect || (this._filterEffect = new FilterEffect.FilterEffect());
|
||||
this._filterEffect.filterArea = value;
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get filterArea() {
|
||||
return this._filterEffect?.filterArea;
|
||||
}
|
||||
};
|
||||
|
||||
exports.effectsMixin = effectsMixin;
|
||||
//# sourceMappingURL=effectsMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
131
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.mjs
generated
vendored
Normal file
131
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
import { FilterEffect } from '../../../filters/FilterEffect.mjs';
|
||||
import { MaskEffectManager } from '../../../rendering/mask/MaskEffectManager.mjs';
|
||||
|
||||
"use strict";
|
||||
const effectsMixin = {
|
||||
_maskEffect: null,
|
||||
_filterEffect: null,
|
||||
/**
|
||||
* @todo Needs docs.
|
||||
* @memberof scene.Container#
|
||||
* @type {Array<Effect>}
|
||||
*/
|
||||
effects: [],
|
||||
/**
|
||||
* @todo Needs docs.
|
||||
* @param effect - The effect to add.
|
||||
* @memberof scene.Container#
|
||||
* @ignore
|
||||
*/
|
||||
addEffect(effect) {
|
||||
const index = this.effects.indexOf(effect);
|
||||
if (index !== -1)
|
||||
return;
|
||||
this.effects.push(effect);
|
||||
this.effects.sort((a, b) => a.priority - b.priority);
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (renderGroup) {
|
||||
renderGroup.structureDidChange = true;
|
||||
}
|
||||
this._updateIsSimple();
|
||||
},
|
||||
/**
|
||||
* @todo Needs docs.
|
||||
* @param effect - The effect to remove.
|
||||
* @memberof scene.Container#
|
||||
* @ignore
|
||||
*/
|
||||
removeEffect(effect) {
|
||||
const index = this.effects.indexOf(effect);
|
||||
if (index === -1)
|
||||
return;
|
||||
this.effects.splice(index, 1);
|
||||
if (this.parentRenderGroup) {
|
||||
this.parentRenderGroup.structureDidChange = true;
|
||||
}
|
||||
this._updateIsSimple();
|
||||
},
|
||||
set mask(value) {
|
||||
const effect = this._maskEffect;
|
||||
if (effect?.mask === value)
|
||||
return;
|
||||
if (effect) {
|
||||
this.removeEffect(effect);
|
||||
MaskEffectManager.returnMaskEffect(effect);
|
||||
this._maskEffect = null;
|
||||
}
|
||||
if (value === null || value === void 0)
|
||||
return;
|
||||
this._maskEffect = MaskEffectManager.getMaskEffect(value);
|
||||
this.addEffect(this._maskEffect);
|
||||
},
|
||||
/**
|
||||
* 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 Graphics} or a {@link Sprite} object. This allows for much faster masking in canvas as it
|
||||
* utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent.
|
||||
* Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong.
|
||||
* 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.
|
||||
* @example
|
||||
* import { Graphics, Sprite } from 'pixi.js';
|
||||
*
|
||||
* const graphics = new Graphics();
|
||||
* graphics.beginFill(0xFF3300);
|
||||
* graphics.drawRect(50, 250, 100, 100);
|
||||
* graphics.endFill();
|
||||
*
|
||||
* const sprite = new Sprite(texture);
|
||||
* sprite.mask = graphics;
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get mask() {
|
||||
return this._maskEffect?.mask;
|
||||
},
|
||||
set filters(value) {
|
||||
if (!Array.isArray(value) && value)
|
||||
value = [value];
|
||||
const effect = this._filterEffect || (this._filterEffect = new FilterEffect());
|
||||
value = value;
|
||||
const hasFilters = value?.length > 0;
|
||||
const hadFilters = effect.filters?.length > 0;
|
||||
const didChange = hasFilters !== hadFilters;
|
||||
value = Array.isArray(value) ? value.slice(0) : value;
|
||||
effect.filters = Object.freeze(value);
|
||||
if (didChange) {
|
||||
if (hasFilters) {
|
||||
this.addEffect(effect);
|
||||
} else {
|
||||
this.removeEffect(effect);
|
||||
effect.filters = value ?? null;
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Sets the filters for the displayObject.
|
||||
* IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
|
||||
* To remove filters simply set this property to `'null'`.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get filters() {
|
||||
return this._filterEffect?.filters;
|
||||
},
|
||||
set filterArea(value) {
|
||||
this._filterEffect || (this._filterEffect = new FilterEffect());
|
||||
this._filterEffect.filterArea = value;
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get filterArea() {
|
||||
return this._filterEffect?.filterArea;
|
||||
}
|
||||
};
|
||||
|
||||
export { effectsMixin };
|
||||
//# sourceMappingURL=effectsMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts
generated
vendored
Normal file
15
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Container } from '../Container';
|
||||
export interface FindMixinConstructor {
|
||||
label?: string;
|
||||
}
|
||||
export interface FindMixin extends Required<FindMixinConstructor> {
|
||||
/**
|
||||
* @deprecated since 8.0.0
|
||||
* @see Container#label
|
||||
*/
|
||||
name: string;
|
||||
getChildByName(label: RegExp | string, deep?: boolean): Container | null;
|
||||
getChildByLabel(label: RegExp | string, deep?: boolean): Container | null;
|
||||
getChildrenByLabel(label: RegExp | string, deep?: boolean, out?: Container[]): Container[];
|
||||
}
|
||||
export declare const findMixin: Partial<Container>;
|
93
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.js
generated
vendored
Normal file
93
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
'use strict';
|
||||
|
||||
var deprecation = require('../../../utils/logging/deprecation.js');
|
||||
|
||||
"use strict";
|
||||
const findMixin = {
|
||||
/**
|
||||
* The instance label of the object.
|
||||
* @memberof scene.Container#
|
||||
* @member {string} label
|
||||
*/
|
||||
label: null,
|
||||
/**
|
||||
* The instance name of the object.
|
||||
* @deprecated since 8.0.0
|
||||
* @see scene.Container#label
|
||||
* @member {string} name
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get name() {
|
||||
deprecation.deprecation(deprecation.v8_0_0, "Container.name property has been removed, use Container.label instead");
|
||||
return this.label;
|
||||
},
|
||||
set name(value) {
|
||||
deprecation.deprecation(deprecation.v8_0_0, "Container.name property has been removed, use Container.label instead");
|
||||
this.label = value;
|
||||
},
|
||||
/**
|
||||
* @method getChildByName
|
||||
* @deprecated since 8.0.0
|
||||
* @param {string} name - Instance name.
|
||||
* @param {boolean}[deep=false] - Whether to search recursively
|
||||
* @returns {Container} The child with the specified name.
|
||||
* @see scene.Container#getChildByLabel
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getChildByName(name, deep = false) {
|
||||
return this.getChildByLabel(name, deep);
|
||||
},
|
||||
/**
|
||||
* Returns the first child in the container with the specified label.
|
||||
*
|
||||
* Recursive searches are done in a pre-order traversal.
|
||||
* @memberof scene.Container#
|
||||
* @param {string|RegExp} label - Instance label.
|
||||
* @param {boolean}[deep=false] - Whether to search recursively
|
||||
* @returns {Container} The child with the specified label.
|
||||
*/
|
||||
getChildByLabel(label, deep = false) {
|
||||
const children = this.children;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
if (child.label === label || label instanceof RegExp && label.test(child.label))
|
||||
return child;
|
||||
}
|
||||
if (deep) {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
const found = child.getChildByLabel(label, true);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
/**
|
||||
* Returns all children in the container with the specified label.
|
||||
* @memberof scene.Container#
|
||||
* @param {string|RegExp} label - Instance label.
|
||||
* @param {boolean}[deep=false] - Whether to search recursively
|
||||
* @param {Container[]} [out=[]] - The array to store matching children in.
|
||||
* @returns {Container[]} An array of children with the specified label.
|
||||
*/
|
||||
getChildrenByLabel(label, deep = false, out = []) {
|
||||
const children = this.children;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
if (child.label === label || label instanceof RegExp && label.test(child.label)) {
|
||||
out.push(child);
|
||||
}
|
||||
}
|
||||
if (deep) {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
children[i].getChildrenByLabel(label, true, out);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
};
|
||||
|
||||
exports.findMixin = findMixin;
|
||||
//# sourceMappingURL=findMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
91
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.mjs
generated
vendored
Normal file
91
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
import { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';
|
||||
|
||||
"use strict";
|
||||
const findMixin = {
|
||||
/**
|
||||
* The instance label of the object.
|
||||
* @memberof scene.Container#
|
||||
* @member {string} label
|
||||
*/
|
||||
label: null,
|
||||
/**
|
||||
* The instance name of the object.
|
||||
* @deprecated since 8.0.0
|
||||
* @see scene.Container#label
|
||||
* @member {string} name
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get name() {
|
||||
deprecation(v8_0_0, "Container.name property has been removed, use Container.label instead");
|
||||
return this.label;
|
||||
},
|
||||
set name(value) {
|
||||
deprecation(v8_0_0, "Container.name property has been removed, use Container.label instead");
|
||||
this.label = value;
|
||||
},
|
||||
/**
|
||||
* @method getChildByName
|
||||
* @deprecated since 8.0.0
|
||||
* @param {string} name - Instance name.
|
||||
* @param {boolean}[deep=false] - Whether to search recursively
|
||||
* @returns {Container} The child with the specified name.
|
||||
* @see scene.Container#getChildByLabel
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getChildByName(name, deep = false) {
|
||||
return this.getChildByLabel(name, deep);
|
||||
},
|
||||
/**
|
||||
* Returns the first child in the container with the specified label.
|
||||
*
|
||||
* Recursive searches are done in a pre-order traversal.
|
||||
* @memberof scene.Container#
|
||||
* @param {string|RegExp} label - Instance label.
|
||||
* @param {boolean}[deep=false] - Whether to search recursively
|
||||
* @returns {Container} The child with the specified label.
|
||||
*/
|
||||
getChildByLabel(label, deep = false) {
|
||||
const children = this.children;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
if (child.label === label || label instanceof RegExp && label.test(child.label))
|
||||
return child;
|
||||
}
|
||||
if (deep) {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
const found = child.getChildByLabel(label, true);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
/**
|
||||
* Returns all children in the container with the specified label.
|
||||
* @memberof scene.Container#
|
||||
* @param {string|RegExp} label - Instance label.
|
||||
* @param {boolean}[deep=false] - Whether to search recursively
|
||||
* @param {Container[]} [out=[]] - The array to store matching children in.
|
||||
* @returns {Container[]} An array of children with the specified label.
|
||||
*/
|
||||
getChildrenByLabel(label, deep = false, out = []) {
|
||||
const children = this.children;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
if (child.label === label || label instanceof RegExp && label.test(child.label)) {
|
||||
out.push(child);
|
||||
}
|
||||
}
|
||||
if (deep) {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
children[i].getChildrenByLabel(label, true, out);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
};
|
||||
|
||||
export { findMixin };
|
||||
//# sourceMappingURL=findMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
27
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.d.ts
generated
vendored
Normal file
27
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Bounds } from '../bounds/Bounds';
|
||||
import type { Size } from '../../../maths/misc/Size';
|
||||
import type { Container } from '../Container';
|
||||
export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
||||
export interface MeasureMixinConstructor {
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
export interface MeasureMixin extends Required<MeasureMixinConstructor> {
|
||||
getSize(out?: Size): Size;
|
||||
setSize(width: number, height?: number): void;
|
||||
setSize(value: Optional<Size, 'height'>): void;
|
||||
getLocalBounds(bounds?: Bounds): Bounds;
|
||||
getBounds(skipUpdate?: boolean, bounds?: Bounds): Bounds;
|
||||
_localBoundsCacheData: LocalBoundsCacheData;
|
||||
_localBoundsCacheId: number;
|
||||
_setWidth(width: number, localWidth: number): void;
|
||||
_setHeight(height: number, localHeight: number): void;
|
||||
}
|
||||
interface LocalBoundsCacheData {
|
||||
data: number[];
|
||||
index: number;
|
||||
didChange: boolean;
|
||||
localBounds: Bounds;
|
||||
}
|
||||
export declare const measureMixin: Partial<Container>;
|
||||
export {};
|
72
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.js
generated
vendored
Normal file
72
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
'use strict';
|
||||
|
||||
var Matrix = require('../../../maths/matrix/Matrix.js');
|
||||
var Bounds = require('../bounds/Bounds.js');
|
||||
var getGlobalBounds = require('../bounds/getGlobalBounds.js');
|
||||
var getLocalBounds = require('../bounds/getLocalBounds.js');
|
||||
var checkChildrenDidChange = require('../utils/checkChildrenDidChange.js');
|
||||
|
||||
"use strict";
|
||||
const tempMatrix = new Matrix.Matrix();
|
||||
const measureMixin = {
|
||||
_localBoundsCacheId: -1,
|
||||
_localBoundsCacheData: null,
|
||||
_setWidth(value, localWidth) {
|
||||
const sign = Math.sign(this.scale.x) || 1;
|
||||
if (localWidth !== 0) {
|
||||
this.scale.x = value / localWidth * sign;
|
||||
} else {
|
||||
this.scale.x = sign;
|
||||
}
|
||||
},
|
||||
_setHeight(value, localHeight) {
|
||||
const sign = Math.sign(this.scale.y) || 1;
|
||||
if (localHeight !== 0) {
|
||||
this.scale.y = value / localHeight * sign;
|
||||
} else {
|
||||
this.scale.y = sign;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Retrieves the local bounds of the container as a Bounds object.
|
||||
* @returns - The bounding area.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getLocalBounds() {
|
||||
if (!this._localBoundsCacheData) {
|
||||
this._localBoundsCacheData = {
|
||||
data: [],
|
||||
index: 1,
|
||||
didChange: false,
|
||||
localBounds: new Bounds.Bounds()
|
||||
};
|
||||
}
|
||||
const localBoundsCacheData = this._localBoundsCacheData;
|
||||
localBoundsCacheData.index = 1;
|
||||
localBoundsCacheData.didChange = false;
|
||||
if (localBoundsCacheData.data[0] !== this._didViewChangeTick) {
|
||||
localBoundsCacheData.didChange = true;
|
||||
localBoundsCacheData.data[0] = this._didViewChangeTick;
|
||||
}
|
||||
checkChildrenDidChange.checkChildrenDidChange(this, localBoundsCacheData);
|
||||
if (localBoundsCacheData.didChange) {
|
||||
getLocalBounds.getLocalBounds(this, localBoundsCacheData.localBounds, tempMatrix);
|
||||
}
|
||||
return localBoundsCacheData.localBounds;
|
||||
},
|
||||
/**
|
||||
* Calculates and returns the (world) bounds of the display object as a [Rectangle]{@link Rectangle}.
|
||||
* @param skipUpdate - Setting 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.
|
||||
* @param bounds - Optional bounds to store the result of the bounds calculation.
|
||||
* @returns - The minimum axis-aligned rectangle in world space that fits around this object.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getBounds(skipUpdate, bounds) {
|
||||
return getGlobalBounds.getGlobalBounds(this, skipUpdate, bounds || new Bounds.Bounds());
|
||||
}
|
||||
};
|
||||
|
||||
exports.measureMixin = measureMixin;
|
||||
//# sourceMappingURL=measureMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
70
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.mjs
generated
vendored
Normal file
70
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
|
||||
import { Bounds } from '../bounds/Bounds.mjs';
|
||||
import { getGlobalBounds } from '../bounds/getGlobalBounds.mjs';
|
||||
import { getLocalBounds } from '../bounds/getLocalBounds.mjs';
|
||||
import { checkChildrenDidChange } from '../utils/checkChildrenDidChange.mjs';
|
||||
|
||||
"use strict";
|
||||
const tempMatrix = new Matrix();
|
||||
const measureMixin = {
|
||||
_localBoundsCacheId: -1,
|
||||
_localBoundsCacheData: null,
|
||||
_setWidth(value, localWidth) {
|
||||
const sign = Math.sign(this.scale.x) || 1;
|
||||
if (localWidth !== 0) {
|
||||
this.scale.x = value / localWidth * sign;
|
||||
} else {
|
||||
this.scale.x = sign;
|
||||
}
|
||||
},
|
||||
_setHeight(value, localHeight) {
|
||||
const sign = Math.sign(this.scale.y) || 1;
|
||||
if (localHeight !== 0) {
|
||||
this.scale.y = value / localHeight * sign;
|
||||
} else {
|
||||
this.scale.y = sign;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Retrieves the local bounds of the container as a Bounds object.
|
||||
* @returns - The bounding area.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getLocalBounds() {
|
||||
if (!this._localBoundsCacheData) {
|
||||
this._localBoundsCacheData = {
|
||||
data: [],
|
||||
index: 1,
|
||||
didChange: false,
|
||||
localBounds: new Bounds()
|
||||
};
|
||||
}
|
||||
const localBoundsCacheData = this._localBoundsCacheData;
|
||||
localBoundsCacheData.index = 1;
|
||||
localBoundsCacheData.didChange = false;
|
||||
if (localBoundsCacheData.data[0] !== this._didViewChangeTick) {
|
||||
localBoundsCacheData.didChange = true;
|
||||
localBoundsCacheData.data[0] = this._didViewChangeTick;
|
||||
}
|
||||
checkChildrenDidChange(this, localBoundsCacheData);
|
||||
if (localBoundsCacheData.didChange) {
|
||||
getLocalBounds(this, localBoundsCacheData.localBounds, tempMatrix);
|
||||
}
|
||||
return localBoundsCacheData.localBounds;
|
||||
},
|
||||
/**
|
||||
* Calculates and returns the (world) bounds of the display object as a [Rectangle]{@link Rectangle}.
|
||||
* @param skipUpdate - Setting 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.
|
||||
* @param bounds - Optional bounds to store the result of the bounds calculation.
|
||||
* @returns - The minimum axis-aligned rectangle in world space that fits around this object.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getBounds(skipUpdate, bounds) {
|
||||
return getGlobalBounds(this, skipUpdate, bounds || new Bounds());
|
||||
}
|
||||
};
|
||||
|
||||
export { measureMixin };
|
||||
//# sourceMappingURL=measureMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.d.ts
generated
vendored
Normal file
8
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Container } from '../Container';
|
||||
export interface OnRenderMixinConstructor {
|
||||
onRender?: (() => void | null);
|
||||
}
|
||||
export interface OnRenderMixin extends Required<OnRenderMixinConstructor> {
|
||||
_onRender: (() => void) | null;
|
||||
}
|
||||
export declare const onRenderMixin: Partial<Container>;
|
39
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.js
generated
vendored
Normal file
39
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
const onRenderMixin = {
|
||||
_onRender: null,
|
||||
set onRender(func) {
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (!func) {
|
||||
if (this._onRender) {
|
||||
renderGroup?.removeOnRender(this);
|
||||
}
|
||||
this._onRender = null;
|
||||
return;
|
||||
}
|
||||
if (!this._onRender) {
|
||||
renderGroup?.addOnRender(this);
|
||||
}
|
||||
this._onRender = func;
|
||||
},
|
||||
/**
|
||||
* This callback is used when the container is rendered. This is where you should add your custom
|
||||
* logic that is needed to be run every frame.
|
||||
*
|
||||
* In v7 many users used `updateTransform` for this, however the way v8 renders objects is different
|
||||
* and "updateTransform" is no longer called every frame
|
||||
* @example
|
||||
* const container = new Container();
|
||||
* container.onRender = () => {
|
||||
* container.rotation += 0.01;
|
||||
* };
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get onRender() {
|
||||
return this._onRender;
|
||||
}
|
||||
};
|
||||
|
||||
exports.onRenderMixin = onRenderMixin;
|
||||
//# sourceMappingURL=onRenderMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onRenderMixin.js","sources":["../../../../src/scene/container/container-mixins/onRenderMixin.ts"],"sourcesContent":["import type { Container } from '../Container';\n\nexport interface OnRenderMixinConstructor\n{\n onRender?: (() => void | null);\n}\nexport interface OnRenderMixin extends Required<OnRenderMixinConstructor>\n{\n _onRender: (() => void) | null;\n}\n\nexport const onRenderMixin: Partial<Container> = {\n _onRender: null,\n\n set onRender(func: () => void)\n {\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (!func)\n {\n if (this._onRender)\n {\n renderGroup?.removeOnRender(this);\n }\n\n this._onRender = null;\n\n return;\n }\n\n if (!this._onRender)\n {\n renderGroup?.addOnRender(this);\n }\n\n this._onRender = func;\n },\n\n /**\n * This callback is used when the container is rendered. This is where you should add your custom\n * logic that is needed to be run every frame.\n *\n * In v7 many users used `updateTransform` for this, however the way v8 renders objects is different\n * and \"updateTransform\" is no longer called every frame\n * @example\n * const container = new Container();\n * container.onRender = () => {\n * container.rotation += 0.01;\n * };\n * @memberof scene.Container#\n */\n get onRender(): () => void\n {\n return this._onRender;\n }\n} as Container;\n"],"names":[],"mappings":";;;AAWO,MAAM,aAAoC,GAAA;AAAA,EAC7C,SAAW,EAAA,IAAA;AAAA,EAEX,IAAI,SAAS,IACb,EAAA;AACI,IAAM,MAAA,WAAA,GAAc,IAAK,CAAA,WAAA,IAAe,IAAK,CAAA,iBAAA,CAAA;AAE7C,IAAA,IAAI,CAAC,IACL,EAAA;AACI,MAAA,IAAI,KAAK,SACT,EAAA;AACI,QAAA,WAAA,EAAa,eAAe,IAAI,CAAA,CAAA;AAAA,OACpC;AAEA,MAAA,IAAA,CAAK,SAAY,GAAA,IAAA,CAAA;AAEjB,MAAA,OAAA;AAAA,KACJ;AAEA,IAAI,IAAA,CAAC,KAAK,SACV,EAAA;AACI,MAAA,WAAA,EAAa,YAAY,IAAI,CAAA,CAAA;AAAA,KACjC;AAEA,IAAA,IAAA,CAAK,SAAY,GAAA,IAAA,CAAA;AAAA,GACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,IAAI,QACJ,GAAA;AACI,IAAA,OAAO,IAAK,CAAA,SAAA,CAAA;AAAA,GAChB;AACJ;;;;"}
|
37
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.mjs
generated
vendored
Normal file
37
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
const onRenderMixin = {
|
||||
_onRender: null,
|
||||
set onRender(func) {
|
||||
const renderGroup = this.renderGroup || this.parentRenderGroup;
|
||||
if (!func) {
|
||||
if (this._onRender) {
|
||||
renderGroup?.removeOnRender(this);
|
||||
}
|
||||
this._onRender = null;
|
||||
return;
|
||||
}
|
||||
if (!this._onRender) {
|
||||
renderGroup?.addOnRender(this);
|
||||
}
|
||||
this._onRender = func;
|
||||
},
|
||||
/**
|
||||
* This callback is used when the container is rendered. This is where you should add your custom
|
||||
* logic that is needed to be run every frame.
|
||||
*
|
||||
* In v7 many users used `updateTransform` for this, however the way v8 renders objects is different
|
||||
* and "updateTransform" is no longer called every frame
|
||||
* @example
|
||||
* const container = new Container();
|
||||
* container.onRender = () => {
|
||||
* container.rotation += 0.01;
|
||||
* };
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get onRender() {
|
||||
return this._onRender;
|
||||
}
|
||||
};
|
||||
|
||||
export { onRenderMixin };
|
||||
//# sourceMappingURL=onRenderMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onRenderMixin.mjs","sources":["../../../../src/scene/container/container-mixins/onRenderMixin.ts"],"sourcesContent":["import type { Container } from '../Container';\n\nexport interface OnRenderMixinConstructor\n{\n onRender?: (() => void | null);\n}\nexport interface OnRenderMixin extends Required<OnRenderMixinConstructor>\n{\n _onRender: (() => void) | null;\n}\n\nexport const onRenderMixin: Partial<Container> = {\n _onRender: null,\n\n set onRender(func: () => void)\n {\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (!func)\n {\n if (this._onRender)\n {\n renderGroup?.removeOnRender(this);\n }\n\n this._onRender = null;\n\n return;\n }\n\n if (!this._onRender)\n {\n renderGroup?.addOnRender(this);\n }\n\n this._onRender = func;\n },\n\n /**\n * This callback is used when the container is rendered. This is where you should add your custom\n * logic that is needed to be run every frame.\n *\n * In v7 many users used `updateTransform` for this, however the way v8 renders objects is different\n * and \"updateTransform\" is no longer called every frame\n * @example\n * const container = new Container();\n * container.onRender = () => {\n * container.rotation += 0.01;\n * };\n * @memberof scene.Container#\n */\n get onRender(): () => void\n {\n return this._onRender;\n }\n} as Container;\n"],"names":[],"mappings":";AAWO,MAAM,aAAoC,GAAA;AAAA,EAC7C,SAAW,EAAA,IAAA;AAAA,EAEX,IAAI,SAAS,IACb,EAAA;AACI,IAAM,MAAA,WAAA,GAAc,IAAK,CAAA,WAAA,IAAe,IAAK,CAAA,iBAAA,CAAA;AAE7C,IAAA,IAAI,CAAC,IACL,EAAA;AACI,MAAA,IAAI,KAAK,SACT,EAAA;AACI,QAAA,WAAA,EAAa,eAAe,IAAI,CAAA,CAAA;AAAA,OACpC;AAEA,MAAA,IAAA,CAAK,SAAY,GAAA,IAAA,CAAA;AAEjB,MAAA,OAAA;AAAA,KACJ;AAEA,IAAI,IAAA,CAAC,KAAK,SACV,EAAA;AACI,MAAA,WAAA,EAAa,YAAY,IAAI,CAAA,CAAA;AAAA,KACjC;AAEA,IAAA,IAAA,CAAK,SAAY,GAAA,IAAA,CAAA;AAAA,GACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,IAAI,QACJ,GAAA;AACI,IAAA,OAAO,IAAK,CAAA,SAAA,CAAA;AAAA,GAChB;AACJ;;;;"}
|
12
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts
generated
vendored
Normal file
12
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { Container } from '../Container';
|
||||
export interface SortMixinConstructor {
|
||||
zIndex?: number;
|
||||
sortDirty?: boolean;
|
||||
sortableChildren?: boolean;
|
||||
}
|
||||
export interface SortMixin extends Required<SortMixinConstructor> {
|
||||
_zIndex: number;
|
||||
sortChildren: () => void;
|
||||
depthOfChildModified: () => void;
|
||||
}
|
||||
export declare const sortMixin: Partial<Container>;
|
71
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.js
generated
vendored
Normal file
71
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
const sortMixin = {
|
||||
_zIndex: 0,
|
||||
/**
|
||||
* Should children be sorted by zIndex at the next render call.
|
||||
*
|
||||
* Will get automatically set to true if a new child is added, or if a child's zIndex changes.
|
||||
* @type {boolean}
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
sortDirty: false,
|
||||
/**
|
||||
* If set to true, the container will sort its children by `zIndex` value
|
||||
* when the next render 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/layers PixiJS Layers}
|
||||
*
|
||||
* 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.
|
||||
* @type {boolean}
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
sortableChildren: false,
|
||||
/**
|
||||
* The zIndex of the container.
|
||||
*
|
||||
* Setting this value, will automatically set the parent to be sortable. 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 display objects within the same container.
|
||||
* @see scene.Container#sortableChildren
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get zIndex() {
|
||||
return this._zIndex;
|
||||
},
|
||||
set zIndex(value) {
|
||||
if (this._zIndex === value)
|
||||
return;
|
||||
this._zIndex = value;
|
||||
this.depthOfChildModified();
|
||||
},
|
||||
depthOfChildModified() {
|
||||
if (this.parent) {
|
||||
this.parent.sortableChildren = true;
|
||||
this.parent.sortDirty = true;
|
||||
}
|
||||
if (this.parentRenderGroup) {
|
||||
this.parentRenderGroup.structureDidChange = true;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Sorts children by zIndex.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
sortChildren() {
|
||||
if (!this.sortDirty)
|
||||
return;
|
||||
this.sortDirty = false;
|
||||
this.children.sort(sortChildren);
|
||||
}
|
||||
};
|
||||
function sortChildren(a, b) {
|
||||
return a._zIndex - b._zIndex;
|
||||
}
|
||||
|
||||
exports.sortMixin = sortMixin;
|
||||
//# sourceMappingURL=sortMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sortMixin.js","sources":["../../../../src/scene/container/container-mixins/sortMixin.ts"],"sourcesContent":["import type { Container } from '../Container';\n\nexport interface SortMixinConstructor\n{\n zIndex?: number;\n sortDirty?: boolean;\n sortableChildren?: boolean;\n}\nexport interface SortMixin extends Required<SortMixinConstructor>\n{\n _zIndex: number;\n\n sortChildren: () => void;\n depthOfChildModified: () => void;\n}\n\nexport const sortMixin: Partial<Container> = {\n _zIndex: 0,\n /**\n * Should children be sorted by zIndex at the next render call.\n *\n * Will get automatically set to true if a new child is added, or if a child's zIndex changes.\n * @type {boolean}\n * @memberof scene.Container#\n */\n sortDirty: false,\n /**\n * If set to true, the container will sort its children by `zIndex` value\n * when the next render is called, or manually if `sortChildren()` is called.\n *\n * This actually changes the order of elements in the array, so should be treated\n * as a basic solution that is not performant compared to other solutions,\n * such as {@link https://github.com/pixijs/layers PixiJS Layers}\n *\n * Also be aware of that this may not work nicely with the `addChildAt()` function,\n * as the `zIndex` sorting may cause the child to automatically sorted to another position.\n * @type {boolean}\n * @memberof scene.Container#\n */\n sortableChildren: false,\n\n /**\n * The zIndex of the container.\n *\n * Setting this value, will automatically set the parent to be sortable. Children will be automatically\n * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,\n * and thus rendered on top of other display objects within the same container.\n * @see scene.Container#sortableChildren\n * @memberof scene.Container#\n */\n get zIndex()\n {\n return this._zIndex;\n },\n\n set zIndex(value: number)\n {\n if (this._zIndex === value) return;\n\n this._zIndex = value;\n\n this.depthOfChildModified();\n },\n\n depthOfChildModified()\n {\n if (this.parent)\n {\n this.parent.sortableChildren = true;\n this.parent.sortDirty = true;\n }\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n },\n\n /**\n * Sorts children by zIndex.\n * @memberof scene.Container#\n */\n sortChildren()\n {\n if (!this.sortDirty) return;\n\n this.sortDirty = false;\n\n this.children.sort(sortChildren);\n },\n} as Container;\n\nfunction sortChildren(a: Container, b: Container): number\n{\n return a._zIndex - b._zIndex;\n}\n"],"names":[],"mappings":";;;AAgBO,MAAM,SAAgC,GAAA;AAAA,EACzC,OAAS,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT,SAAW,EAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcX,gBAAkB,EAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWlB,IAAI,MACJ,GAAA;AACI,IAAA,OAAO,IAAK,CAAA,OAAA,CAAA;AAAA,GAChB;AAAA,EAEA,IAAI,OAAO,KACX,EAAA;AACI,IAAA,IAAI,KAAK,OAAY,KAAA,KAAA;AAAO,MAAA,OAAA;AAE5B,IAAA,IAAA,CAAK,OAAU,GAAA,KAAA,CAAA;AAEf,IAAA,IAAA,CAAK,oBAAqB,EAAA,CAAA;AAAA,GAC9B;AAAA,EAEA,oBACA,GAAA;AACI,IAAA,IAAI,KAAK,MACT,EAAA;AACI,MAAA,IAAA,CAAK,OAAO,gBAAmB,GAAA,IAAA,CAAA;AAC/B,MAAA,IAAA,CAAK,OAAO,SAAY,GAAA,IAAA,CAAA;AAAA,KAC5B;AAEA,IAAA,IAAI,KAAK,iBACT,EAAA;AACI,MAAA,IAAA,CAAK,kBAAkB,kBAAqB,GAAA,IAAA,CAAA;AAAA,KAChD;AAAA,GACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YACA,GAAA;AACI,IAAA,IAAI,CAAC,IAAK,CAAA,SAAA;AAAW,MAAA,OAAA;AAErB,IAAA,IAAA,CAAK,SAAY,GAAA,KAAA,CAAA;AAEjB,IAAK,IAAA,CAAA,QAAA,CAAS,KAAK,YAAY,CAAA,CAAA;AAAA,GACnC;AACJ,EAAA;AAEA,SAAS,YAAA,CAAa,GAAc,CACpC,EAAA;AACI,EAAO,OAAA,CAAA,CAAE,UAAU,CAAE,CAAA,OAAA,CAAA;AACzB;;;;"}
|
69
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.mjs
generated
vendored
Normal file
69
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
const sortMixin = {
|
||||
_zIndex: 0,
|
||||
/**
|
||||
* Should children be sorted by zIndex at the next render call.
|
||||
*
|
||||
* Will get automatically set to true if a new child is added, or if a child's zIndex changes.
|
||||
* @type {boolean}
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
sortDirty: false,
|
||||
/**
|
||||
* If set to true, the container will sort its children by `zIndex` value
|
||||
* when the next render 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/layers PixiJS Layers}
|
||||
*
|
||||
* 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.
|
||||
* @type {boolean}
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
sortableChildren: false,
|
||||
/**
|
||||
* The zIndex of the container.
|
||||
*
|
||||
* Setting this value, will automatically set the parent to be sortable. 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 display objects within the same container.
|
||||
* @see scene.Container#sortableChildren
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
get zIndex() {
|
||||
return this._zIndex;
|
||||
},
|
||||
set zIndex(value) {
|
||||
if (this._zIndex === value)
|
||||
return;
|
||||
this._zIndex = value;
|
||||
this.depthOfChildModified();
|
||||
},
|
||||
depthOfChildModified() {
|
||||
if (this.parent) {
|
||||
this.parent.sortableChildren = true;
|
||||
this.parent.sortDirty = true;
|
||||
}
|
||||
if (this.parentRenderGroup) {
|
||||
this.parentRenderGroup.structureDidChange = true;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Sorts children by zIndex.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
sortChildren() {
|
||||
if (!this.sortDirty)
|
||||
return;
|
||||
this.sortDirty = false;
|
||||
this.children.sort(sortChildren);
|
||||
}
|
||||
};
|
||||
function sortChildren(a, b) {
|
||||
return a._zIndex - b._zIndex;
|
||||
}
|
||||
|
||||
export { sortMixin };
|
||||
//# sourceMappingURL=sortMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sortMixin.mjs","sources":["../../../../src/scene/container/container-mixins/sortMixin.ts"],"sourcesContent":["import type { Container } from '../Container';\n\nexport interface SortMixinConstructor\n{\n zIndex?: number;\n sortDirty?: boolean;\n sortableChildren?: boolean;\n}\nexport interface SortMixin extends Required<SortMixinConstructor>\n{\n _zIndex: number;\n\n sortChildren: () => void;\n depthOfChildModified: () => void;\n}\n\nexport const sortMixin: Partial<Container> = {\n _zIndex: 0,\n /**\n * Should children be sorted by zIndex at the next render call.\n *\n * Will get automatically set to true if a new child is added, or if a child's zIndex changes.\n * @type {boolean}\n * @memberof scene.Container#\n */\n sortDirty: false,\n /**\n * If set to true, the container will sort its children by `zIndex` value\n * when the next render is called, or manually if `sortChildren()` is called.\n *\n * This actually changes the order of elements in the array, so should be treated\n * as a basic solution that is not performant compared to other solutions,\n * such as {@link https://github.com/pixijs/layers PixiJS Layers}\n *\n * Also be aware of that this may not work nicely with the `addChildAt()` function,\n * as the `zIndex` sorting may cause the child to automatically sorted to another position.\n * @type {boolean}\n * @memberof scene.Container#\n */\n sortableChildren: false,\n\n /**\n * The zIndex of the container.\n *\n * Setting this value, will automatically set the parent to be sortable. Children will be automatically\n * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,\n * and thus rendered on top of other display objects within the same container.\n * @see scene.Container#sortableChildren\n * @memberof scene.Container#\n */\n get zIndex()\n {\n return this._zIndex;\n },\n\n set zIndex(value: number)\n {\n if (this._zIndex === value) return;\n\n this._zIndex = value;\n\n this.depthOfChildModified();\n },\n\n depthOfChildModified()\n {\n if (this.parent)\n {\n this.parent.sortableChildren = true;\n this.parent.sortDirty = true;\n }\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n },\n\n /**\n * Sorts children by zIndex.\n * @memberof scene.Container#\n */\n sortChildren()\n {\n if (!this.sortDirty) return;\n\n this.sortDirty = false;\n\n this.children.sort(sortChildren);\n },\n} as Container;\n\nfunction sortChildren(a: Container, b: Container): number\n{\n return a._zIndex - b._zIndex;\n}\n"],"names":[],"mappings":";AAgBO,MAAM,SAAgC,GAAA;AAAA,EACzC,OAAS,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT,SAAW,EAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcX,gBAAkB,EAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWlB,IAAI,MACJ,GAAA;AACI,IAAA,OAAO,IAAK,CAAA,OAAA,CAAA;AAAA,GAChB;AAAA,EAEA,IAAI,OAAO,KACX,EAAA;AACI,IAAA,IAAI,KAAK,OAAY,KAAA,KAAA;AAAO,MAAA,OAAA;AAE5B,IAAA,IAAA,CAAK,OAAU,GAAA,KAAA,CAAA;AAEf,IAAA,IAAA,CAAK,oBAAqB,EAAA,CAAA;AAAA,GAC9B;AAAA,EAEA,oBACA,GAAA;AACI,IAAA,IAAI,KAAK,MACT,EAAA;AACI,MAAA,IAAA,CAAK,OAAO,gBAAmB,GAAA,IAAA,CAAA;AAC/B,MAAA,IAAA,CAAK,OAAO,SAAY,GAAA,IAAA,CAAA;AAAA,KAC5B;AAEA,IAAA,IAAI,KAAK,iBACT,EAAA;AACI,MAAA,IAAA,CAAK,kBAAkB,kBAAqB,GAAA,IAAA,CAAA;AAAA,KAChD;AAAA,GACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YACA,GAAA;AACI,IAAA,IAAI,CAAC,IAAK,CAAA,SAAA;AAAW,MAAA,OAAA;AAErB,IAAA,IAAA,CAAK,SAAY,GAAA,KAAA,CAAA;AAEjB,IAAK,IAAA,CAAA,QAAA,CAAS,KAAK,YAAY,CAAA,CAAA;AAAA,GACnC;AACJ,EAAA;AAEA,SAAS,YAAA,CAAa,GAAc,CACpC,EAAA;AACI,EAAO,OAAA,CAAA,CAAE,UAAU,CAAE,CAAA,OAAA,CAAA;AACzB;;;;"}
|
9
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.d.ts
generated
vendored
Normal file
9
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Point } from '../../../maths/point/Point';
|
||||
import type { PointData } from '../../../maths/point/PointData';
|
||||
import type { Container } from '../Container';
|
||||
export interface ToLocalGlobalMixin {
|
||||
getGlobalPosition(point?: Point, skipUpdate?: boolean): Point;
|
||||
toGlobal<P extends PointData = Point>(position: PointData, point?: P, skipUpdate?: boolean): P;
|
||||
toLocal<P extends PointData = Point>(position: PointData, from?: Container, point?: P, skipUpdate?: boolean): P;
|
||||
}
|
||||
export declare const toLocalGlobalMixin: Partial<Container>;
|
68
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.js
generated
vendored
Normal file
68
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
'use strict';
|
||||
|
||||
var Matrix = require('../../../maths/matrix/Matrix.js');
|
||||
var Point = require('../../../maths/point/Point.js');
|
||||
var getGlobalBounds = require('../bounds/getGlobalBounds.js');
|
||||
|
||||
"use strict";
|
||||
const toLocalGlobalMixin = {
|
||||
/**
|
||||
* Returns the global position of the container.
|
||||
* @param point - The optional point to write the global value to.
|
||||
* @param skipUpdate - Should we skip the update transform.
|
||||
* @returns - The updated point.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getGlobalPosition(point = new Point.Point(), skipUpdate = false) {
|
||||
if (this.parent) {
|
||||
this.parent.toGlobal(this._position, point, skipUpdate);
|
||||
} else {
|
||||
point.x = this._position.x;
|
||||
point.y = this._position.y;
|
||||
}
|
||||
return point;
|
||||
},
|
||||
/**
|
||||
* Calculates the global position of the container.
|
||||
* @param position - The world origin to calculate from.
|
||||
* @param point - A Point object in which to store the value, optional
|
||||
* (otherwise will create a new Point).
|
||||
* @param skipUpdate - Should we skip the update transform.
|
||||
* @returns - A point object representing the position of this object.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
toGlobal(position, point, skipUpdate = false) {
|
||||
if (!skipUpdate) {
|
||||
this.updateLocalTransform();
|
||||
const globalMatrix = getGlobalBounds.updateTransformBackwards(this, new Matrix.Matrix());
|
||||
globalMatrix.append(this.localTransform);
|
||||
return globalMatrix.apply(position, point);
|
||||
}
|
||||
return this.worldTransform.apply(position, point);
|
||||
},
|
||||
/**
|
||||
* Calculates the local position of the container relative to another point.
|
||||
* @param position - The world origin to calculate from.
|
||||
* @param from - The Container to calculate the global position from.
|
||||
* @param point - A Point object in which to store the value, optional
|
||||
* (otherwise will create a new Point).
|
||||
* @param skipUpdate - Should we skip the update transform
|
||||
* @returns - A point object representing the position of this object
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
toLocal(position, from, point, skipUpdate) {
|
||||
if (from) {
|
||||
position = from.toGlobal(position, point, skipUpdate);
|
||||
}
|
||||
if (!skipUpdate) {
|
||||
this.updateLocalTransform();
|
||||
const globalMatrix = getGlobalBounds.updateTransformBackwards(this, new Matrix.Matrix());
|
||||
globalMatrix.append(this.localTransform);
|
||||
return globalMatrix.applyInverse(position, point);
|
||||
}
|
||||
return this.worldTransform.applyInverse(position, point);
|
||||
}
|
||||
};
|
||||
|
||||
exports.toLocalGlobalMixin = toLocalGlobalMixin;
|
||||
//# sourceMappingURL=toLocalGlobalMixin.js.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
66
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.mjs
generated
vendored
Normal file
66
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.mjs
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
|
||||
import { Point } from '../../../maths/point/Point.mjs';
|
||||
import { updateTransformBackwards } from '../bounds/getGlobalBounds.mjs';
|
||||
|
||||
"use strict";
|
||||
const toLocalGlobalMixin = {
|
||||
/**
|
||||
* Returns the global position of the container.
|
||||
* @param point - The optional point to write the global value to.
|
||||
* @param skipUpdate - Should we skip the update transform.
|
||||
* @returns - The updated point.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
getGlobalPosition(point = new Point(), skipUpdate = false) {
|
||||
if (this.parent) {
|
||||
this.parent.toGlobal(this._position, point, skipUpdate);
|
||||
} else {
|
||||
point.x = this._position.x;
|
||||
point.y = this._position.y;
|
||||
}
|
||||
return point;
|
||||
},
|
||||
/**
|
||||
* Calculates the global position of the container.
|
||||
* @param position - The world origin to calculate from.
|
||||
* @param point - A Point object in which to store the value, optional
|
||||
* (otherwise will create a new Point).
|
||||
* @param skipUpdate - Should we skip the update transform.
|
||||
* @returns - A point object representing the position of this object.
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
toGlobal(position, point, skipUpdate = false) {
|
||||
if (!skipUpdate) {
|
||||
this.updateLocalTransform();
|
||||
const globalMatrix = updateTransformBackwards(this, new Matrix());
|
||||
globalMatrix.append(this.localTransform);
|
||||
return globalMatrix.apply(position, point);
|
||||
}
|
||||
return this.worldTransform.apply(position, point);
|
||||
},
|
||||
/**
|
||||
* Calculates the local position of the container relative to another point.
|
||||
* @param position - The world origin to calculate from.
|
||||
* @param from - The Container to calculate the global position from.
|
||||
* @param point - A Point object in which to store the value, optional
|
||||
* (otherwise will create a new Point).
|
||||
* @param skipUpdate - Should we skip the update transform
|
||||
* @returns - A point object representing the position of this object
|
||||
* @memberof scene.Container#
|
||||
*/
|
||||
toLocal(position, from, point, skipUpdate) {
|
||||
if (from) {
|
||||
position = from.toGlobal(position, point, skipUpdate);
|
||||
}
|
||||
if (!skipUpdate) {
|
||||
this.updateLocalTransform();
|
||||
const globalMatrix = updateTransformBackwards(this, new Matrix());
|
||||
globalMatrix.append(this.localTransform);
|
||||
return globalMatrix.applyInverse(position, point);
|
||||
}
|
||||
return this.worldTransform.applyInverse(position, point);
|
||||
}
|
||||
};
|
||||
|
||||
export { toLocalGlobalMixin };
|
||||
//# sourceMappingURL=toLocalGlobalMixin.mjs.map
|
1
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user