9. Working with timelines

Timelines allow the authors of Sophie books to create complex books with reader-triggered actions that change over time. The current timeline model in Sophie 2 is loop-based; it is provisional and provides only a fraction of the capabilities of timelines to come in the final version of Sophie 2.

To edit timelines in Sophie, you need to open the timeline interface, which is the bottom flap. The timeline interface will show the timeline for the current page (if you have no frames selected) or for the frame or group currently selected. Every page in a Sophie book has a master timeline which shows all the frames on the page. Each frame (or group of frames) has its own timeline as well. The page, frames, and groups of frames have timeline halos, which will open up the timeline HUD for the page, frame, or group of frames.

Currently, timelines can not be triggered by the book; they start automatically when a page that uses a timeline is opened and loop. Much more timeline functionality will be added in the future to Sophie.

Timelines start automatically when a page is opened.

The page timeline

The page timeline appears in the bottom flap when the page is selected. It consists of a slider and list of objects in the page (frames and groups); it looks like this:

../images/PageTimeline.png

The slider can be dragged back and forth, which will show what the page looks like at that point in time. You can adjust frames' visibility and position over time in this way.

You can set the resolution of the timeline with the controls in the bottom left of the timeline interface; it's currently set to 500 ms.

You can move frames around on the page: if you move the slider to 0:10, then move a frame from the upper left corner to the lower right corner, when the timeline is played back, the frame will move from the upper left corner to the lower right corner at 0:10.

You can also use the page timeline to change visibility: a frame can be made to appear from 0:00-0:10, then disappear, then reappear at 0:20. To do this, move the slider to 0:10. Then select the frame you want to hide; open the frame's appearance HUD:

../images/BorderFillHUD.png

Uncheck the checkbox that says Visibility. Then move the slider on the timeline to 0:20; turn Visibility back on. When the timeline is played back, the frame will disappear from 0:10 to 0:20.

You can set the length of the page timeline by clicking the page's timeline halo to open the page's timeline HUD. The page timeline HUD might look like this:

../images/PageTimelineHUD.png

The most importing setting is the number under Main: this is the length of the looping part of the timeline. By default this is set to ten minutes (the value used here is currently in animation frames, rather than in seconds); you can increase or decrease this number to change the amount of time in the main loop. Adding values to the Intro or Outro fields will add time before or after the timeline's main loop. If these numbers are very high, for example, the timeline's loop might not play.

Every frame on the page is also listed in the page timeline HUD. Beside each of their names is a drop-down menu which lists which part of the timeline will play and how long that section of the timeline is. You can change the lengths of individual frame timelines here.

The frame timeline

Each frame's timeline appears in the bottom flap when the frame is selected. Frames have frame channels, which appear below the slider. There are three kinds of frame channels in Sophie 2.0: visibility, location, and media state.

Here is a frame timeline showing changes in both visibility and location:

../images/FrameTimeline.png

Playing back a timeline

When a book with timelines is opened in Sophie Reader or in Preview mode, the timeline on a page starts playing as soon as the user turns to that page.

Intro, main and outro

Each timeline consists of three parts: the intro section, the main section, and the outro section. Their length may be edited in the timeline HUD of the selected object. By default, the intro section is played when the item is shown; then the main section plays (which can be looped); and before hiding (or after a main part which is not looped), the outro section plays. By default, intro and outro have lengths of zero and are synchronized with the page timeline.

../images/FrameTimelineHUD.png