Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into a problem that the library doesn't have the ability to start the transition from the values of object's properties that were on the transition at the moment t, which can be difficult to calculate, especially if the transition rule is complex (for example, outInBounce).
In my case, it was needed to initialize the scales of objects that approach the player from the horizon and grow up nonlinearly and which have to be between the player and the horizon when scene appears.
So I added a
time shift
parameter to all transitions (exceptdissolve
) which defines initial value of object's property when the transition starts.A short explanation of how
time shift
parameter behaves and interacts with thedelay
parameter in transition with durationT
:time shift
> 0 then transition begins with the value of the object's properties that would have been reached by the object by time equalstime shift
with an unmodified transition and lasts forT - time shift
ms.delay
ms, and then transition continues forT - time shift
ms.time shift
< 0 then trasition behaves as ifdelay
is defined and equals|time shift|
.delay
> 0 andtime shift
< 0 then transition waits fordelay + |time shift|
ms and then starts from the initial values of object's property and lasts forT
ms.These code changes will not affect any existing projects.