@pixi/core
Version:
Core PixiJS
61 lines (58 loc) • 1.52 kB
JavaScript
import { MASK_TYPES } from '@pixi/constants';
import { Filter } from '../filters/Filter.mjs';
class MaskData {
constructor(maskObject = null) {
this.type = MASK_TYPES.NONE;
this.autoDetect = true;
this.maskObject = maskObject || null;
this.pooled = false;
this.isMaskData = true;
this.resolution = null;
this.multisample = Filter.defaultMultisample;
this.enabled = true;
this.colorMask = 15;
this._filters = null;
this._stencilCounter = 0;
this._scissorCounter = 0;
this._scissorRect = null;
this._scissorRectLocal = null;
this._colorMask = 15;
this._target = null;
}
get filter() {
return this._filters ? this._filters[0] : null;
}
set filter(value) {
if (value) {
if (this._filters) {
this._filters[0] = value;
} else {
this._filters = [value];
}
} else {
this._filters = null;
}
}
reset() {
if (this.pooled) {
this.maskObject = null;
this.type = MASK_TYPES.NONE;
this.autoDetect = true;
}
this._target = null;
this._scissorRectLocal = null;
}
copyCountersOrReset(maskAbove) {
if (maskAbove) {
this._stencilCounter = maskAbove._stencilCounter;
this._scissorCounter = maskAbove._scissorCounter;
this._scissorRect = maskAbove._scissorRect;
} else {
this._stencilCounter = 0;
this._scissorCounter = 0;
this._scissorRect = null;
}
}
}
export { MaskData };
//# sourceMappingURL=MaskData.mjs.map