Reproducing A Clever Animation Product, Part 19

Today I finally finished handling adjustments to the starting time of events in the animation, using the same syntax as the Greensock product I’ve been emulating.

In order to do this cleanly I chose to build a separate list of timing events to which I could refer. This is an array of objects where each object is comprised of an element name (possibly with an extension, e.g., “:1”), an absolute starting time, and an absolute ending time. If a value is provided for the fifth (optional) parameter in the addTransformToList function then it may have two parts. One part would be a label used for a previous element, in which case the event would start at the end to the first transform event defined for that element. The other part could be a time offset, which modifies the start time based on the time just described or, by default, the end of the most recently defined transformation that extended the overall length of the animation.

The memory structures are defined like this:

The parsing of adjustments is accomplished like this:

The animation should look just the same as it has before, but using entirely new and, theoretically, more flexible notation.

This entry was posted in Tools and methods and tagged , , . Bookmark the permalink.

Leave a Reply