@urso/core 0.4.46 → 0.4.48
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/build/js/index.js +1 -1
- package/package.json +1 -1
- package/src/js/components/editor/_info.js +4 -0
- package/src/js/components/editor/api.js +72 -0
- package/src/js/components/editor/controller.js +13 -0
- package/src/js/config/main.js +1 -0
- package/src/js/lib/loader.js +6 -1
- package/src/js/modules/objects/models/emitter.js +14 -1
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
class ComponentsEditorApi {
|
|
2
|
+
|
|
3
|
+
constructor() {
|
|
4
|
+
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
//styles
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
//assets
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* returns types list and keys to create new asset
|
|
14
|
+
* @returns { types, keys }
|
|
15
|
+
*/
|
|
16
|
+
getAssetTypes() {
|
|
17
|
+
const types = Urso.types.assets;
|
|
18
|
+
return { types, keys: this._assetsKeys };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* get current assets list
|
|
23
|
+
* @returns {Array} assets list
|
|
24
|
+
*/
|
|
25
|
+
getCurrentAssets() {
|
|
26
|
+
const template = Urso.template.get();
|
|
27
|
+
return template.assets;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* add new asset into game
|
|
32
|
+
* @param {String} type
|
|
33
|
+
* @param {Object} fields
|
|
34
|
+
*/
|
|
35
|
+
addAsset(type, fields) {
|
|
36
|
+
//return new asset system id
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
//objects
|
|
41
|
+
getCurrentObjects() {
|
|
42
|
+
return list;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
getObjectsTypes() {
|
|
46
|
+
return list; // with fields keys
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
addObject() {
|
|
50
|
+
//return id
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//settings
|
|
54
|
+
editObject(id, key, value) {
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//////////////// sys
|
|
59
|
+
|
|
60
|
+
_assetsKeys = {
|
|
61
|
+
ATLAS: ['key', 'path'], // path to json file
|
|
62
|
+
BITMAPFONT: ['key', 'path'], // path to json file
|
|
63
|
+
CONTAINER: ['name'],
|
|
64
|
+
FONT: ['key', 'path'],
|
|
65
|
+
IMAGE: ['key', 'path'],
|
|
66
|
+
JSON: ['key', 'path'],
|
|
67
|
+
SPINE: ['key', 'path'], // path to json file
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = ComponentsEditorApi;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
ComponentsBaseController = require('./../base/controller.js');
|
|
2
|
+
|
|
3
|
+
class ComponentsEditorController extends ComponentsBaseController {
|
|
4
|
+
constructor(params) {
|
|
5
|
+
super(params);
|
|
6
|
+
|
|
7
|
+
this._api = this.getInstance('Api');
|
|
8
|
+
window.api = this._api;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = ComponentsEditorController;
|
package/src/js/config/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
let ConfigMain = {
|
|
2
2
|
title: 'Urso', //game title
|
|
3
|
+
appVersion: 0, //app version, also used as anticache "appVersion=${appVersion}" when not 0
|
|
3
4
|
mode: "development", // development/production/testing
|
|
4
5
|
extendingChain: ['Urso.Core'], //chain that will be set as Urso.Game
|
|
5
6
|
defaultScene: 'play', //default scene to display
|
package/src/js/lib/loader.js
CHANGED
|
@@ -97,8 +97,13 @@ class LibLoader {
|
|
|
97
97
|
return false;
|
|
98
98
|
|
|
99
99
|
this._isRunning = true;
|
|
100
|
-
|
|
101
100
|
const loader = new PIXI.Loader();
|
|
101
|
+
const appVersion = Urso.config.appVersion;
|
|
102
|
+
|
|
103
|
+
if (appVersion) {
|
|
104
|
+
loader.defaultQueryString = `appVersion=${appVersion}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
102
107
|
this._assetsQuery.forEach(asset => {
|
|
103
108
|
// TODO: check to load
|
|
104
109
|
|
|
@@ -41,7 +41,20 @@ class ModulesObjectsModelsEmitter extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
41
41
|
if (texture)
|
|
42
42
|
textures.push(texture);
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
if (textures.length > 1) {
|
|
46
|
+
const texturesOptions = {
|
|
47
|
+
framerate: 20,
|
|
48
|
+
loop: true,
|
|
49
|
+
textures
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
this.emitter = new PIXI.particles.Emitter(this._baseObject, texturesOptions, cfg.data);
|
|
53
|
+
this.emitter.particleConstructor = PIXI.particles.AnimatedParticle; //import { AnimatedParticle } from "pixi-particles";
|
|
54
|
+
} else {
|
|
55
|
+
this.emitter = new PIXI.particles.Emitter(this._baseObject, textures, cfg.data);
|
|
56
|
+
}
|
|
57
|
+
|
|
45
58
|
this.emitter.emit = this.autostart;
|
|
46
59
|
this.emitter.autoUpdate = true;
|
|
47
60
|
}
|