@urso/core 0.7.15 → 0.7.16

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.15",
3
+ "version": "0.7.16",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -71,6 +71,15 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
71
71
  this._baseObject.skeleton.setToSetupPose();
72
72
  }
73
73
 
74
+ /**
75
+ * set skin by name and reset animation to first frame
76
+ * @param {String} skinName
77
+ */
78
+ setSkinByNameAndReset(skinName) {
79
+ this.setSkinByName(skinName);
80
+ this.setToSetupPose();
81
+ }
82
+
74
83
  /**
75
84
  * play spine animation and execute function after animation completes
76
85
  * @param {String} animation - name of the animation to be played
@@ -130,6 +139,15 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
130
139
  * @param {Number} [track] - you can define track number to stop
131
140
  */
132
141
  stopTrack(track) {
142
+ this.clearTrack(track);
143
+ this._baseObject.state.addEmptyAnimation(track, 0.2, 0); //int trackIndex, float mixDuration, float delay
144
+ }
145
+
146
+ /**
147
+ * clear track animation
148
+ * @param {Number} [track] - you can define track number to stop
149
+ */
150
+ clearTrack(track) {
133
151
  this._baseObject.state.clearTrack(track);
134
152
  }
135
153