@urso/core 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -77,3 +77,72 @@ PIXI.Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {
77
77
  previousWidth = currentWidth;
78
78
  }
79
79
  };
80
+
81
+ /**
82
+ * Ignoring parent mask on render by ignoreParentMask flag.
83
+ * @param { Object } renderer
84
+ */
85
+ PIXI.Container.prototype.renderAdvanced = function (renderer) {
86
+ var filters = this.filters;
87
+ var mask = this._mask;
88
+ // push filter first as we need to ensure the stencil buffer is correct for any masking
89
+ if (filters) {
90
+
91
+ if (!this._enabledFilters) {
92
+ this._enabledFilters = [];
93
+ }
94
+
95
+ this._enabledFilters.length = 0;
96
+
97
+ for (var i = 0; i < filters.length; i++) {
98
+ if (filters[i].enabled) {
99
+ this._enabledFilters.push(filters[i]);
100
+ }
101
+ }
102
+ }
103
+
104
+ var flush = (filters && this._enabledFilters && this._enabledFilters.length)
105
+ || (mask && (!mask.isMaskData || (mask.enabled && (mask.autoDetect || mask.type !== constants.MASK_TYPES.NONE))));
106
+
107
+ if (flush) {
108
+ renderer.batch.flush();
109
+ }
110
+
111
+ if (filters && this._enabledFilters && this._enabledFilters.length) {
112
+ renderer.filter.push(this, this._enabledFilters);
113
+ }
114
+
115
+ if (mask) {
116
+ renderer.mask.push(this, this._mask);
117
+ }
118
+
119
+ if (this.cullable) {
120
+ this._renderWithCulling(renderer);
121
+ } else {
122
+ this._render(renderer);
123
+
124
+ for (var i = 0, j = this.children.length; i < j; ++i) {
125
+ if (!this.children[i].ignoreParentMask || !mask) {
126
+ this.children[i].render(renderer);
127
+ } else if (mask) {
128
+ renderer.batch.flush();
129
+ renderer.mask.pop(this);
130
+ this.children[i].render(renderer);
131
+ renderer.batch.flush();
132
+ renderer.mask.push(this, this._mask);
133
+ }
134
+ }
135
+ }
136
+
137
+ if (flush) {
138
+ renderer.batch.flush();
139
+ }
140
+
141
+ if (mask) {
142
+ renderer.mask.pop(this);
143
+ }
144
+
145
+ if (filters && this._enabledFilters && this._enabledFilters.length) {
146
+ renderer.filter.pop();
147
+ }
148
+ }
@@ -45,6 +45,7 @@ class ModulesObjectsBaseModel {
45
45
  this.visible = Urso.helper.recursiveGet('visible', params, true);
46
46
  this.alpha = Urso.helper.recursiveGet('alpha', params, 1);
47
47
  this.blendMode = Urso.helper.recursiveGet('blendMode', params, 1);
48
+ this.ignoreParentMask = Urso.helper.recursiveGet('ignoreParentMask', params, false); //if true - do not apply parent mask on rendering
48
49
 
49
50
  this.transitionDelay = Urso.helper.recursiveGet('transitionDelay', params, false); //time in ms
50
51
  this.transitionDuration = Urso.helper.recursiveGet('transitionDuration', params, false); //time in ms
@@ -284,7 +284,7 @@ class ModulesObjectsProxy {
284
284
  'textAlign ': 'style.align',
285
285
  'enabled': 'input.enabled',
286
286
  'cacheAsBitmap': 'cacheAsBitmap',
287
-
287
+ 'ignoreParentMask': 'ignoreParentMask',
288
288
  //baseObject functions
289
289
  'toGlobal': 'toGlobal'
290
290
  };