start method
Tween
start(
[ - int? time,
- bool overrideStartingValues = false
])
Implementation
Tween start([int? time, bool overrideStartingValues = false]) {
time ??= now();
if (this._isPlaying) {
return this;
}
// eslint-disable-next-line
this._group.add(this);
this._repeat = this._initialRepeat;
if (this._reversed) {
// If we were reversed (f.e. using the yoyo feature) then we need to
// flip the tween direction back to forward.
this._reversed = false;
for (var property in this._valuesStartRepeat.keys) {
this._swapEndStartRepeatValues(property);
this._valuesStart[property] = this._valuesStartRepeat[property];
}
}
this._isPlaying = true;
this._isPaused = false;
this._onStartCallbackFired = false;
this._onEveryStartCallbackFired = false;
this._isChainStopped = false;
this._startTime = time + this._delayTime;
if (!this._propertiesAreSetUp || overrideStartingValues) {
this._propertiesAreSetUp = true;
// If dynamic is not enabled, clone the end values instead of using the passed-in end values.
if (!this._isDynamic) {
var tmp = {};
for (var prop in this._valuesEnd.keys){
tmp[prop] = this._valuesEnd[prop];
}
this._valuesEnd = tmp;
}
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, overrideStartingValues);
}
return this;
}