@urso/core 0.7.0 → 0.7.3

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.
@@ -27,8 +27,8 @@ object-assign
27
27
  */
28
28
 
29
29
  /*!
30
- * @pixi-spine/loader-base - v3.0.13
31
- * Compiled Mon, 13 Sep 2021 16:46:34 UTC
30
+ * @pixi-spine/loader-base - v3.1.0
31
+ * Compiled Wed, 03 Aug 2022 16:58:28 UTC
32
32
  *
33
33
  * @pixi-spine/loader-base is licensed under the MIT License.
34
34
  * http://www.opensource.org/licenses/mit-license
@@ -37,8 +37,8 @@ object-assign
37
37
  */
38
38
 
39
39
  /*!
40
- * @pixi-spine/runtime-3.8 - v3.0.13
41
- * Compiled Mon, 13 Sep 2021 16:46:34 UTC
40
+ * @pixi-spine/runtime-3.8 - v3.1.0
41
+ * Compiled Wed, 03 Aug 2022 16:58:28 UTC
42
42
  *
43
43
  * @pixi-spine/runtime-3.8 is licensed under the MIT License.
44
44
  * http://www.opensource.org/licenses/mit-license
@@ -47,114 +47,298 @@ object-assign
47
47
  */
48
48
 
49
49
  /*!
50
- * @pixi/constants - v6.2.1
51
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
50
+ * @pixi/accessibility - v6.5.8
51
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
52
+ *
53
+ * @pixi/accessibility is licensed under the MIT License.
54
+ * http://www.opensource.org/licenses/mit-license
55
+ */
56
+
57
+ /*!
58
+ * @pixi/app - v6.5.8
59
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
60
+ *
61
+ * @pixi/app is licensed under the MIT License.
62
+ * http://www.opensource.org/licenses/mit-license
63
+ */
64
+
65
+ /*!
66
+ * @pixi/compressed-textures - v6.5.8
67
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
68
+ *
69
+ * @pixi/compressed-textures is licensed under the MIT License.
70
+ * http://www.opensource.org/licenses/mit-license
71
+ */
72
+
73
+ /*!
74
+ * @pixi/constants - v6.5.8
75
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
52
76
  *
53
77
  * @pixi/constants is licensed under the MIT License.
54
78
  * http://www.opensource.org/licenses/mit-license
55
79
  */
56
80
 
57
81
  /*!
58
- * @pixi/core - v6.2.1
59
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
82
+ * @pixi/core - v6.5.8
83
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
60
84
  *
61
85
  * @pixi/core is licensed under the MIT License.
62
86
  * http://www.opensource.org/licenses/mit-license
63
87
  */
64
88
 
65
89
  /*!
66
- * @pixi/display - v6.2.1
67
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
90
+ * @pixi/display - v6.5.8
91
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
68
92
  *
69
93
  * @pixi/display is licensed under the MIT License.
70
94
  * http://www.opensource.org/licenses/mit-license
71
95
  */
72
96
 
73
97
  /*!
74
- * @pixi/extract - v6.2.1
75
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
98
+ * @pixi/extensions - v6.5.8
99
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
100
+ *
101
+ * @pixi/extensions is licensed under the MIT License.
102
+ * http://www.opensource.org/licenses/mit-license
103
+ */
104
+
105
+ /*!
106
+ * @pixi/extract - v6.5.8
107
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
76
108
  *
77
109
  * @pixi/extract is licensed under the MIT License.
78
110
  * http://www.opensource.org/licenses/mit-license
79
111
  */
80
112
 
81
113
  /*!
82
- * @pixi/filter-displacement - v6.2.1
83
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
114
+ * @pixi/filter-alpha - v6.5.8
115
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
116
+ *
117
+ * @pixi/filter-alpha is licensed under the MIT License.
118
+ * http://www.opensource.org/licenses/mit-license
119
+ */
120
+
121
+ /*!
122
+ * @pixi/filter-blur - v6.5.8
123
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
124
+ *
125
+ * @pixi/filter-blur is licensed under the MIT License.
126
+ * http://www.opensource.org/licenses/mit-license
127
+ */
128
+
129
+ /*!
130
+ * @pixi/filter-color-matrix - v6.5.8
131
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
132
+ *
133
+ * @pixi/filter-color-matrix is licensed under the MIT License.
134
+ * http://www.opensource.org/licenses/mit-license
135
+ */
136
+
137
+ /*!
138
+ * @pixi/filter-displacement - v6.5.8
139
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
84
140
  *
85
141
  * @pixi/filter-displacement is licensed under the MIT License.
86
142
  * http://www.opensource.org/licenses/mit-license
87
143
  */
88
144
 
89
145
  /*!
90
- * @pixi/loaders - v6.2.1
91
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
146
+ * @pixi/filter-fxaa - v6.5.8
147
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
148
+ *
149
+ * @pixi/filter-fxaa is licensed under the MIT License.
150
+ * http://www.opensource.org/licenses/mit-license
151
+ */
152
+
153
+ /*!
154
+ * @pixi/filter-noise - v6.5.8
155
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
156
+ *
157
+ * @pixi/filter-noise is licensed under the MIT License.
158
+ * http://www.opensource.org/licenses/mit-license
159
+ */
160
+
161
+ /*!
162
+ * @pixi/graphics - v6.5.8
163
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
164
+ *
165
+ * @pixi/graphics is licensed under the MIT License.
166
+ * http://www.opensource.org/licenses/mit-license
167
+ */
168
+
169
+ /*!
170
+ * @pixi/interaction - v6.5.8
171
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
172
+ *
173
+ * @pixi/interaction is licensed under the MIT License.
174
+ * http://www.opensource.org/licenses/mit-license
175
+ */
176
+
177
+ /*!
178
+ * @pixi/loaders - v6.5.8
179
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
92
180
  *
93
181
  * @pixi/loaders is licensed under the MIT License.
94
182
  * http://www.opensource.org/licenses/mit-license
95
183
  */
96
184
 
97
185
  /*!
98
- * @pixi/math - v6.2.1
99
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
186
+ * @pixi/math - v6.5.8
187
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
100
188
  *
101
189
  * @pixi/math is licensed under the MIT License.
102
190
  * http://www.opensource.org/licenses/mit-license
103
191
  */
104
192
 
105
193
  /*!
106
- * @pixi/mixin-get-child-by-name - v6.2.1
107
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
194
+ * @pixi/mesh - v6.5.8
195
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
196
+ *
197
+ * @pixi/mesh is licensed under the MIT License.
198
+ * http://www.opensource.org/licenses/mit-license
199
+ */
200
+
201
+ /*!
202
+ * @pixi/mesh-extras - v6.5.8
203
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
204
+ *
205
+ * @pixi/mesh-extras is licensed under the MIT License.
206
+ * http://www.opensource.org/licenses/mit-license
207
+ */
208
+
209
+ /*!
210
+ * @pixi/mixin-cache-as-bitmap - v6.5.8
211
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
212
+ *
213
+ * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.
214
+ * http://www.opensource.org/licenses/mit-license
215
+ */
216
+
217
+ /*!
218
+ * @pixi/mixin-get-child-by-name - v6.5.8
219
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
108
220
  *
109
221
  * @pixi/mixin-get-child-by-name is licensed under the MIT License.
110
222
  * http://www.opensource.org/licenses/mit-license
111
223
  */
112
224
 
113
225
  /*!
114
- * @pixi/mixin-get-global-position - v6.2.1
115
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
226
+ * @pixi/mixin-get-global-position - v6.5.8
227
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
116
228
  *
117
229
  * @pixi/mixin-get-global-position is licensed under the MIT License.
118
230
  * http://www.opensource.org/licenses/mit-license
119
231
  */
120
232
 
121
233
  /*!
122
- * @pixi/polyfill - v6.2.1
123
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
234
+ * @pixi/particle-container - v6.5.8
235
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
236
+ *
237
+ * @pixi/particle-container is licensed under the MIT License.
238
+ * http://www.opensource.org/licenses/mit-license
239
+ */
240
+
241
+ /*!
242
+ * @pixi/polyfill - v6.5.8
243
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
124
244
  *
125
245
  * @pixi/polyfill is licensed under the MIT License.
126
246
  * http://www.opensource.org/licenses/mit-license
127
247
  */
128
248
 
129
249
  /*!
130
- * @pixi/prepare - v6.2.1
131
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
250
+ * @pixi/prepare - v6.5.8
251
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
132
252
  *
133
253
  * @pixi/prepare is licensed under the MIT License.
134
254
  * http://www.opensource.org/licenses/mit-license
135
255
  */
136
256
 
137
257
  /*!
138
- * @pixi/runner - v6.2.1
139
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
258
+ * @pixi/runner - v6.5.8
259
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
140
260
  *
141
261
  * @pixi/runner is licensed under the MIT License.
142
262
  * http://www.opensource.org/licenses/mit-license
143
263
  */
144
264
 
145
265
  /*!
146
- * @pixi/ticker - v6.2.1
147
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
266
+ * @pixi/settings - v6.5.8
267
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
268
+ *
269
+ * @pixi/settings is licensed under the MIT License.
270
+ * http://www.opensource.org/licenses/mit-license
271
+ */
272
+
273
+ /*!
274
+ * @pixi/sprite - v6.5.8
275
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
276
+ *
277
+ * @pixi/sprite is licensed under the MIT License.
278
+ * http://www.opensource.org/licenses/mit-license
279
+ */
280
+
281
+ /*!
282
+ * @pixi/sprite-animated - v6.5.8
283
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
284
+ *
285
+ * @pixi/sprite-animated is licensed under the MIT License.
286
+ * http://www.opensource.org/licenses/mit-license
287
+ */
288
+
289
+ /*!
290
+ * @pixi/sprite-tiling - v6.5.8
291
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
292
+ *
293
+ * @pixi/sprite-tiling is licensed under the MIT License.
294
+ * http://www.opensource.org/licenses/mit-license
295
+ */
296
+
297
+ /*!
298
+ * @pixi/spritesheet - v6.5.8
299
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
300
+ *
301
+ * @pixi/spritesheet is licensed under the MIT License.
302
+ * http://www.opensource.org/licenses/mit-license
303
+ */
304
+
305
+ /*!
306
+ * @pixi/text - v6.5.8
307
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
308
+ *
309
+ * @pixi/text is licensed under the MIT License.
310
+ * http://www.opensource.org/licenses/mit-license
311
+ */
312
+
313
+ /*!
314
+ * @pixi/text-bitmap - v6.5.8
315
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
316
+ *
317
+ * @pixi/text-bitmap is licensed under the MIT License.
318
+ * http://www.opensource.org/licenses/mit-license
319
+ */
320
+
321
+ /*!
322
+ * @pixi/ticker - v6.5.8
323
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
148
324
  *
149
325
  * @pixi/ticker is licensed under the MIT License.
150
326
  * http://www.opensource.org/licenses/mit-license
151
327
  */
152
328
 
153
329
  /*!
154
- * GSAP 3.7.1
330
+ * @pixi/utils - v6.5.8
331
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
332
+ *
333
+ * @pixi/utils is licensed under the MIT License.
334
+ * http://www.opensource.org/licenses/mit-license
335
+ */
336
+
337
+ /*!
338
+ * GSAP 3.11.3
155
339
  * https://greensock.com
156
340
  *
157
- * @license Copyright 2008-2021, GreenSock. All rights reserved.
341
+ * @license Copyright 2008-2022, GreenSock. All rights reserved.
158
342
  * Subject to the terms at https://greensock.com/standard-license or for
159
343
  * Club GreenSock members, the agreement issued with that membership.
160
344
  * @author: Jack Doyle, jack@greensock.com
@@ -169,8 +353,8 @@ object-assign
169
353
  */
170
354
 
171
355
  /*!
172
- * pixi-spine - v3.0.13
173
- * Compiled Mon, 13 Sep 2021 16:46:43 UTC
356
+ * pixi-spine - v3.1.0
357
+ * Compiled Wed, 03 Aug 2022 17:00:10 UTC
174
358
  *
175
359
  * pixi-spine is licensed under the MIT License.
176
360
  * http://www.opensource.org/licenses/mit-license
@@ -179,8 +363,8 @@ object-assign
179
363
  */
180
364
 
181
365
  /*!
182
- * pixi-viewport - v4.34.3
183
- * Compiled Wed, 01 Dec 2021 19:28:04 UTC
366
+ * pixi-viewport - v4.37.0
367
+ * Compiled Sun, 23 Oct 2022 14:02:15 UTC
184
368
  *
185
369
  * pixi-viewport is licensed under the MIT License.
186
370
  * http://www.opensource.org/licenses/mit-license
@@ -189,8 +373,8 @@ object-assign
189
373
  */
190
374
 
191
375
  /*!
192
- * pixi.js - v6.2.1
193
- * Compiled Tue, 21 Dec 2021 19:56:15 UTC
376
+ * pixi.js - v6.5.8
377
+ * Compiled Sun, 23 Oct 2022 23:01:45 UTC
194
378
  *
195
379
  * pixi.js is licensed under the MIT License.
196
380
  * http://www.opensource.org/licenses/mit-license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.0",
3
+ "version": "0.7.3",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -29,7 +29,7 @@
29
29
  "pixi-particles": "^4.3.0",
30
30
  "pixi-projection": "0.3.15",
31
31
  "pixi-scrollbox": "^2.3.1",
32
- "pixi-spine": "^3.0.13",
32
+ "pixi-spine": "^3.1.2",
33
33
  "pixi-text-input": "^1.0.6",
34
34
  "pixi-viewport": "^4.34.0",
35
35
  "pixi.js": "^6.2.0"
@@ -14,7 +14,7 @@ class ComponentsEditorApi {
14
14
  const template = Urso.template.get();
15
15
  return template.styles;
16
16
  }
17
-
17
+
18
18
 
19
19
  //assets
20
20
 
@@ -83,24 +83,44 @@ class ComponentsEditorApi {
83
83
  //////////////// sys
84
84
 
85
85
  _assetsKeys = {
86
- ATLAS: ['key', 'path'], // path to json file
87
- BITMAPFONT: ['key', 'path'], // path to json file
88
- CONTAINER: ['name'],
89
- FONT: ['key', 'path'],
90
- IMAGE: ['key', 'path'],
91
- JSON: ['key', 'path'],
92
- SPINE: ['key', 'path'], // path to json file
86
+ ATLAS: [{ name: 'key', type: 'text' }, { name: 'path', type: 'file' }], // path to json file
87
+ BITMAPFONT: [{ name: 'key', type: 'text' }, { name: 'path', type: 'file' }], // path to json file
88
+ CONTAINER: [{ name: 'key', type: 'text' }],
89
+ FONT: [{ name: 'key', type: 'text' }, { name: 'path', type: 'file' }], // path to json file
90
+ IMAGE: [{ name: 'key', type: 'text' }, { name: 'path', type: 'file' }], // path to json file
91
+ JSON: [{ name: 'key', type: 'text' }, { name: 'path', type: 'file' }], // path to json file
92
+ SPINE: [{ name: 'key', type: 'text' }, { name: 'path', type: 'file' }], // path to json file
93
93
  }
94
94
 
95
- _commonObjectsKeys = ['id', 'name', 'class', 'x', 'y', 'z', 'anchorX', 'anchorY', 'scaleX', 'scaleY', 'angle', 'visible', 'alpha'];
95
+ _commonObjectsKeys = [
96
+ { name: 'id', type: 'text' },
97
+ { name: 'name', type: 'text' },
98
+ { name: 'class', type: 'text' },
99
+ { name: 'x', type: 'number' },
100
+ { name: 'y', type: 'number' },
101
+ { name: 'z', type: 'number' },
102
+ { name: 'anchorX', type: 'number', range: [-1, 1] },
103
+ { name: 'anchorY', type: 'number', range: [-1, 1] },
104
+ { name: 'scaleX', type: 'number' },
105
+ { name: 'scaleY', type: 'number' },
106
+ { name: 'angle', type: 'number', range: [0, 360] },
107
+ { name: 'alpha', type: 'number', range: [0, 1] },
108
+ { name: 'visible', type: 'boolean' },
109
+ ];
96
110
 
97
111
  _objectsKeys = {
98
- BITMAPTEXT: Urso.helper.mergeArrays(this._commonObjectsKeys, ['text', 'fontName', 'fontSize']),
99
- COMPONENT: Urso.helper.mergeArrays(this._commonObjectsKeys, ['componentName']),
112
+ BITMAPTEXT: Urso.helper.mergeArrays(this._commonObjectsKeys, [{ name: 'text', type: 'text' }, { name: 'fontName', type: 'text' }, { name: 'fontSize', type: 'text' }]),
113
+ COMPONENT: Urso.helper.mergeArrays(this._commonObjectsKeys, [{ name: 'componentName', type: 'text' }]),
100
114
  CONTAINER: this._commonObjectsKeys,
101
- GROUP: Urso.helper.mergeArrays(this._commonObjectsKeys, ['groupName']),
102
- IMAGE: Urso.helper.mergeArrays(this._commonObjectsKeys, ['assetKey']),
103
- TEXT: Urso.helper.mergeArrays(this._commonObjectsKeys, ['text', 'fontFamily', 'fontSize', 'fill', 'stroke'])
115
+ GROUP: Urso.helper.mergeArrays(this._commonObjectsKeys, [{ name: 'groupName', type: 'text' }]),
116
+ IMAGE: Urso.helper.mergeArrays(this._commonObjectsKeys, [{ name: 'assetKey', type: 'text' }]),
117
+ TEXT: Urso.helper.mergeArrays(this._commonObjectsKeys, [
118
+ { name: 'text', type: 'text' },
119
+ { name: 'fontFamily', type: 'text' },
120
+ { name: 'fontSize', type: 'text' },
121
+ { name: 'fill', type: 'text' },
122
+ { name: 'stroke', type: 'text' }
123
+ ])
104
124
  }
105
125
  }
106
126
 
@@ -16,22 +16,25 @@ class ObjectPoolMember {
16
16
 
17
17
  /**
18
18
  * @param {Function} constructorFunction - function to constract element
19
- * @param {Function} constructorFunction - function to reset element when put back to pool
19
+ * @param {Function} resetFunction - function to reset element when put back to pool
20
20
  * @param {Number} [initialSize] - initial pool size. Use only if you not using keys when constract
21
21
  * @param {Number} [maxSize] - max pool size. Old elements will be removed from pool
22
+ * @param {Function} removeFunction - function to remove element from pool. Happens, when max size is reached
22
23
  */
23
24
  class LibObjectPool {
24
25
 
25
26
  _pool = {};
26
- resetFunction = () => { };
27
27
  constructorFunction = () => { };
28
+ resetFunction = () => { };
29
+ removeFunction = () => { };
28
30
  _maxSize = 0;
29
31
 
30
32
  _lastBranchKeys = {};
31
33
  _putTimeCache = {};
32
34
 
33
- constructor(constructorFunction, resetFunction = (obj) => obj, initialSize = 0, maxSize = 0) {
35
+ constructor(constructorFunction, resetFunction = (obj) => obj, initialSize = 0, maxSize = 0, removeFunction = (obj) => obj) {
34
36
  this.resetFunction = resetFunction;
37
+ this.removeFunction = removeFunction;
35
38
  this.constructorFunction = constructorFunction;
36
39
  this._maxSize = maxSize;
37
40
 
@@ -112,6 +115,7 @@ class LibObjectPool {
112
115
  delete this._pool[element.key][element.branchKey];
113
116
 
114
117
  //reset element
118
+ this.removeFunction(element.data);
115
119
  element.free = false;
116
120
  element.putCacheTimeKey = 0;
117
121
  element.key = null;
@@ -125,7 +125,7 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
125
125
  .filter((container) => container._baseObject.worldVisible)
126
126
  .filter((container) => !container._needBlock)
127
127
  .filter((container) => {
128
- let height = container.getAbsoluteSize().height;
128
+ const height = container.getAbsoluteSize().height;
129
129
  return container.height - height < 0;
130
130
  })
131
131
  .sort((firstContainer, secondContainer) => secondContainer.dragIndex - firstContainer.dragIndex);
@@ -184,30 +184,17 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
184
184
  * @returns { Array }
185
185
  */
186
186
  _getObjectPoints(container) {
187
- if (Urso.device.desktop) {
188
- const { x, y } = this._getScaleAndPositionRecursive(this);
189
- const { width, height } = container._mask;
190
- const { scaleX, scaleY } = this._getScaleAndPositionRecursive(this);
191
-
192
- return [
193
- { x, y },
194
- { x: x + width * scaleX, y },
195
- { x: x + width * scaleX, y: y + height * scaleY },
196
- { x, y: y + height * scaleY }
197
- ];
198
-
199
- } else {
200
- const { x, y } = container._mask.toGlobal(new PIXI.Point(0, 0));
201
- const { width, height } = container._mask;
202
- const { scaleX, scaleY } = this._getScaleAndPositionRecursive(this);
203
- return [
204
- { x, y },
205
- { x: x + width * scaleX, y },
206
- { x: x + width * scaleX, y: y + height * scaleY },
207
- { x, y: y + height * scaleY }
208
- ];
209
- }
187
+ const { x, y } = container._mask.toGlobal(new PIXI.Point(0, 0));
188
+
189
+ const { width, height } = container._mask;
190
+ const { scaleX, scaleY } = this._getScaleAndPositionRecursive(this);
210
191
 
192
+ return [
193
+ { x, y },
194
+ { x: x + width * scaleX, y },
195
+ { x: x + width * scaleX, y: y + height * scaleY },
196
+ { x, y: y + height * scaleY }
197
+ ];
211
198
  }
212
199
 
213
200
  /**
@@ -495,19 +482,13 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
495
482
  * Drags container on pointer move.
496
483
  * @param { Object } event
497
484
  */
498
- _onPointerMove(event) {
485
+ _onPointerMove(event) {
499
486
  let { data: { global: { x, y } } } = event;
500
487
 
501
- if (Urso.device.desktop) {
502
- x = Urso.scenes.getMouseCoords().x;
503
- y = Urso.scenes.getMouseCoords().y;
504
- }
505
-
506
488
  if (!this._startPosition) {
507
489
  this._startPosition = { x, y };
508
490
  }
509
491
 
510
-
511
492
  if (!this._isActive({ x, y })) {
512
493
  this._moveInProgress = false;
513
494
  return;
@@ -633,6 +614,7 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
633
614
  this._moveStartedY = event.changedTouches[0].offsetY || event.changedTouches[0].clientY;
634
615
  this._documentPointerStart(event);
635
616
  break;
617
+ case 'mousemove':
636
618
  case 'touchmove':
637
619
  this._documentPointerMove(event);
638
620
  break;
@@ -643,9 +625,6 @@ class ModulesObjectsModelsDragContainer extends ModulesObjectsModelsContainer {
643
625
  case 'wheel':
644
626
  this._documentWheelScroll(event);
645
627
  break;
646
- case 'pointermove':
647
- this._onPointerMove(event);
648
- break;
649
628
  default:
650
629
  break;
651
630
  }
@@ -23,6 +23,7 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
23
23
  };
24
24
 
25
25
  params.animation = this.animation; //we redefine original property here
26
+ this.contents = Urso.helper.recursiveGet('contents', params, []);
26
27
  }
27
28
 
28
29
  /**
@@ -35,6 +36,25 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
35
36
  this._baseObject.state.setAnimation(track, animationName, loopFlag);
36
37
  }
37
38
 
39
+ /**
40
+ * set up the mixes between animations
41
+ * @param {String} from - animation name
42
+ * @param {String} to - animation name
43
+ * @param {Number} duration - time in seconds
44
+ * @example setMix("walk", "jump", 0.2)
45
+ */
46
+ setMix(from, to, duration) {
47
+ this._baseObject.stateData.setMix(from, to, duration);
48
+ }
49
+
50
+ /**
51
+ * Clears all listeners and resubscribes to spine events
52
+ */
53
+ clearListeners() {
54
+ this._baseObject.state.clearListeners();
55
+ this._baseObject.state.addListener({ event: this._eventHandler.bind(this) });
56
+ }
57
+
38
58
  /**
39
59
  * set skin by name
40
60
  * @param {String} skinName
@@ -226,6 +246,9 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
226
246
  if (!spineAsset)
227
247
  Urso.logger.error('ModulesObjectsModelsSpine assets error: no spine object ' + this.assetKey);
228
248
 
249
+ if (!spineAsset.spineData)
250
+ Urso.logger.error('ModulesObjectsModelsSpine assets error: no spine correct object (no spineData) for key ' + this.assetKey);
251
+
229
252
  this._baseObject = new PIXI.spine.Spine(spineAsset.spineData);
230
253
  //this._baseObject.state.timeScale = this.animation.timeScale;
231
254
  Object.defineProperty(this._baseObject.state, 'timeScale', { get: this.getTimeScale.bind(this) });
@@ -256,7 +279,7 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
256
279
  if (replaceSlotContents)
257
280
  currentSlot.removeChildren(); //todo check if its proxy and reset parent
258
281
 
259
- object.parent = this; //todo make removeChild for addedToSlotObjects
282
+ this.addChild(object); //todo make removeChild for addedToSlotObjects
260
283
  currentSlot.addChild(object._baseObject);
261
284
  Urso.objects.refreshStyles();
262
285
  } else {
@@ -273,4 +296,4 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
273
296
  }
274
297
  }
275
298
 
276
- module.exports = ModulesObjectsModelsSpine;
299
+ module.exports = ModulesObjectsModelsSpine;
@@ -46,6 +46,7 @@ class PropertyAdapter {
46
46
  Urso.types.objects.GROUP,
47
47
  Urso.types.objects.SCROLLBOX,
48
48
  Urso.types.objects.SLIDER,
49
+ Urso.types.objects.SPINE,
49
50
  Urso.types.objects.WORLD
50
51
  ];
51
52
 
@@ -203,7 +204,7 @@ class PropertyAdapter {
203
204
  if (typeof object.anchorX !== 'number' || object.anchorX < 0 || object.anchorX > 1)
204
205
  Urso.logger.error('AnchorX value is not valid!', object);
205
206
 
206
- if (this._canBeParent(object)) { //parent types
207
+ if (this._canBeParent(object) && !this._typesWithoutAnchor.includes(object.type)) { //parent types
207
208
  if (object.anchorX === 0)
208
209
  return 0;
209
210
 
@@ -231,7 +232,7 @@ class PropertyAdapter {
231
232
  if (typeof object.anchorY !== 'number' || object.anchorY < 0 || object.anchorY > 1)
232
233
  Urso.logger.error('AnchorY value is not valid!', object);
233
234
 
234
- if (this._canBeParent(object)) { //parent types
235
+ if (this._canBeParent(object) && !this._typesWithoutAnchor.includes(object.type)) { //parent types
235
236
  if (object.anchorY === 0)
236
237
  return 0;
237
238