@urso/core 0.4.43 → 0.4.46
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
|
@@ -64,6 +64,24 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
64
64
|
* @param {String[]} animations - names of the animations to be played
|
|
65
65
|
*/
|
|
66
66
|
playInSequence(animations) {
|
|
67
|
+
this._playInSequenceAndThen(animations);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* play spine animations in sequence and execute function after last animation completes
|
|
72
|
+
* @param {String[]} animations - names of the animations to be played
|
|
73
|
+
* @param {Function} func - function to be executed
|
|
74
|
+
*/
|
|
75
|
+
playInSequenceAndThen(animations, func) {
|
|
76
|
+
this._playInSequenceAndThen(animations, func);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* play spine animations in sequence and execute function after last animation completes
|
|
81
|
+
* @param {String[]} animations - names of the animations to be played
|
|
82
|
+
* @param {Function} func - function to be executed
|
|
83
|
+
*/
|
|
84
|
+
_playInSequenceAndThen(animations, func) {
|
|
67
85
|
this.stop();
|
|
68
86
|
let removeSelf = () => { };
|
|
69
87
|
let animationCount = 0;
|
|
@@ -75,6 +93,7 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
75
93
|
if (animations[animationCount])
|
|
76
94
|
this.play(animations[animationCount])
|
|
77
95
|
else {
|
|
96
|
+
func && func();
|
|
78
97
|
removeSelf();
|
|
79
98
|
}
|
|
80
99
|
}
|
|
@@ -85,29 +104,6 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
85
104
|
this.play(animations[0]);
|
|
86
105
|
}
|
|
87
106
|
|
|
88
|
-
/**
|
|
89
|
-
* play spine animations in sequence and execute function after last animation completes
|
|
90
|
-
* @param {String[]} animations - names of the animations to be played
|
|
91
|
-
* @param {Function} func - function to be executed
|
|
92
|
-
*/
|
|
93
|
-
playInSequenceAndThen(animations, func) {
|
|
94
|
-
let animationsLeft = animations.length;
|
|
95
|
-
let removeSelf = () => { };
|
|
96
|
-
|
|
97
|
-
let completer = {
|
|
98
|
-
complete: () => {
|
|
99
|
-
if (--animationsLeft === 0) {
|
|
100
|
-
func && func();
|
|
101
|
-
removeSelf();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
removeSelf = () => this._baseObject.state.removeListener(completer);
|
|
107
|
-
this._baseObject.state.addListener(completer);
|
|
108
|
-
this.playInSequence(animations);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
107
|
/**
|
|
112
108
|
* stop track animation
|
|
113
109
|
* @param {Number} [track] - you can define track number to stop
|
|
@@ -192,7 +188,7 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
192
188
|
findSlot(name) {
|
|
193
189
|
return this._baseObject.skeleton.findSlot(name)
|
|
194
190
|
}
|
|
195
|
-
|
|
191
|
+
|
|
196
192
|
/**
|
|
197
193
|
* returns skeleton's bone by it's name
|
|
198
194
|
* @param {string} name
|
|
@@ -211,7 +207,7 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
211
207
|
return this._baseObject.spineData.findAnimation(name)
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
|
|
210
|
+
|
|
215
211
|
/**
|
|
216
212
|
* returns event from spineData by it's name
|
|
217
213
|
* @param {string} name
|
|
@@ -88,6 +88,11 @@ class ModulesObjectsProxy {
|
|
|
88
88
|
|
|
89
89
|
this._setProperty(target, propertyName, value, oldValue);
|
|
90
90
|
|
|
91
|
+
//if property is text - we will update it
|
|
92
|
+
if (propertyName === 'text') {
|
|
93
|
+
target._baseObject.updateText(true);
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
this._checkMaxSize(target);
|
|
92
97
|
|
|
93
98
|
//setup dirty to recalc params
|