@urso/core 0.7.32 → 0.7.34

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.7.32",
3
+ "version": "0.7.34",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -185,18 +185,17 @@ class ModulesAssetsService {
185
185
  let imageData = Urso.cache.getAtlas(assetKey);
186
186
  const folderPath = imageData.url.split('/').slice(0, -1).join('/');
187
187
 
188
- for (let i = 0; i < imageData.spritesheet._frames.length; i++) {
189
- let frame = imageData.spritesheet._frames[i];
190
- let texture = imageData.textures[i];
191
- let newFilename = frame.filename;
188
+ for (const name of Object.keys(imageData.spritesheet._frames)) {
189
+ let texture = imageData.textures[name];
190
+ let newFilename = name;
192
191
 
193
- if (!frame.filename.includes('/'))
194
- newFilename = folderPath + '/' + frame.filename;
192
+ if (!name.includes('/'))
193
+ newFilename = folderPath + '/' + name;
195
194
 
196
195
  Urso.cache.addFile(newFilename, texture);
197
196
 
198
- if(assetModel.cacheTextures) {
199
- const textureKey = newFilename.split('/').pop().split('.')[0];
197
+ if (assetModel.cacheTextures) {
198
+ const textureKey = newFilename.split('.')[0];
200
199
  Urso.cache.addTexture(textureKey, texture);
201
200
  }
202
201
  }
@@ -195,6 +195,12 @@ class ModulesObjectsBaseModel {
195
195
 
196
196
  return newTexture;
197
197
  }
198
+
199
+ // sorts children by zIndex
200
+ sortChildren() {
201
+ if(this._baseObject.children?.length > 0)
202
+ this._baseObject.sortChildren();
203
+ }
198
204
  }
199
205
 
200
206
  module.exports = ModulesObjectsBaseModel;
@@ -233,7 +233,7 @@ class ModulesObjectsProxy {
233
233
  'class': 'class',
234
234
  'x': 'x',
235
235
  'y': 'y',
236
- 'z': 'z',
236
+ 'z': 'zIndex',
237
237
  'angle': 'angle',
238
238
  'anchorX': 'anchor.x', //'anchor.x',
239
239
  'anchorY': 'anchor.y', //'anchor.y',