The Timeline controller object allows timelines to be controlled in event sheets.
Much like tweens, timelines can be optionally tagged when they are played using one of the Play actions. Tags are useful to later control a timeline (or multiple timelines sharing the same tags) with some of the other actions, conditions or expressions.
In the simplest case, a timeline will affect the instances that were used to create the timeline in the editor. Using the Set Instance action it is possible to use different instances to the ones used in the editor. Below are some short examples to help illustrate how this action works.
In the below example the timeline plugin Play action is used by itself on startup. This plays the timeline affecting the instances used in the editor to create the timeline. The timeline is tagged "new-timeline".
In this example the timeline plugin Play action is used together with the system plugin Create Object action and the timeline plugin Set Instance action. This plays the timeline affecting the newly created instance. The new instance will be used in the track with ID "a-track-id" and the timeline is tagged "new-timeline"
This example is similar to the last one, but instead of creating a new instance from scratch, the one picked by a collision event is used.
When using the Play action after one or more Set Instance actions, it is possible that one or more similar timelines will start playing. This will depend on the amount of currently picked instances for each given object type.
In the example below a timeline will be played for each group of instances.
This is the preview of the timeline in the editor. It has two different tracks and placeholder instances.
Using the Set Instance action we specify to play a timeline for each picked group of instances at the start of the layout
Lastly the preview of the layout shows that two different timelines where created to accommodate for the four instances found at the start of the layout.
There are a couple of cases in which it is possible to ignore using the track ID property of a track as well as omit using the track ID parameter of the Set Instance action.
In this case it is possible to not use the track ID, as there is only one instance so there is no need to make any choice. The track ID must be empty in both the timeline track and the Set Instance action.
In the case it is needed to replace all of the instance of a timeline using the Set Instance action, it is possible to skip using a track ID for each track and on each call to Set Instance. If there is one Set Instance action for each track in the timeline, the instances will be replaced in the same order they appear in the timeline.
The images bellow show how a timeline and it's properties might look in in this case.
In this particular case the octopus sprite is used in the first track while the toster sprite is used in the second track. Because no track IDs are used, order is assumed to be the same as that defined in the editor.
These are the names for built-in ease functions that can be used with the TimelineController Ease expression.