dbm 1.1.16 → 1.1.17
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/flow/FlowProperty.js +6 -0
- package/package.json +1 -1
- package/updater/PropertyUpdater.js +20 -0
package/flow/FlowProperty.js
CHANGED
|
@@ -48,6 +48,12 @@ export default class FlowProperty extends Dbm.flow.FlowBaseObject {
|
|
|
48
48
|
return this;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
addAddionalAnimation(aFromValue, aToValue, aTime = 0.5, aDelay = 0, aEasing = null) {
|
|
52
|
+
Dbm.getInstance().repository.getItem("propertyUpdater").controller.addPropertyAnimation(this, aFromValue, aToValue, aTime, aDelay, aEasing);
|
|
53
|
+
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
delayValue(aToValue, aDelay = 0) {
|
|
52
58
|
Dbm.getInstance().repository.getItem("propertyUpdater").controller.delayUpdateProperty(this, aToValue, aDelay);
|
|
53
59
|
|
package/package.json
CHANGED
|
@@ -122,6 +122,26 @@ export default class PropertyUpdater extends Dbm.core.BaseObject {
|
|
|
122
122
|
return this;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
addPropertyAnimation(aProperty, aFromValue, aToValue, aTime, aDelay = 0, aEasing = null) {
|
|
126
|
+
|
|
127
|
+
let tweenObject = {"envelope": aFromValue};
|
|
128
|
+
if(!aEasing) {
|
|
129
|
+
aEasing = Easing.Quadratic.Out;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let tween = new Tween(tweenObject).to({"envelope": aToValue}, 1000*aTime).delay(1000*aDelay).easing(aEasing).onUpdate(function(aData) {
|
|
133
|
+
aProperty.value = aData.envelope;
|
|
134
|
+
}).onComplete(() => {this.removeTween(tween)}).start();
|
|
135
|
+
|
|
136
|
+
let tweens = [].concat(this.item.tweens);
|
|
137
|
+
tweens.push(tween);
|
|
138
|
+
this.item.tweens = tweens;
|
|
139
|
+
|
|
140
|
+
this._currentTweens.set(aProperty, tween);
|
|
141
|
+
|
|
142
|
+
return this;
|
|
143
|
+
}
|
|
144
|
+
|
|
125
145
|
delayUpdateProperty(aProperty, aToValue, aDelay = 0) {
|
|
126
146
|
if(this._currentTweens.has(aProperty)) {
|
|
127
147
|
this._currentTweens.get(aProperty).stop();
|