Animatron/player — pull request #31 by shamansir (2012-07-20 09:47:19+00:00)
Title: Add `R_STAY` to repeat modes

`R_STAY` is the new repeat mode among three others (`R_ONCE`, `R_LOOP`, `R_BOUNCE`), it plays clip to the end and stays at the last frame (in `R_ONCE` mode, it disappears), if parent band exceeds its own band.

Now, `Builder` instances has five methods to control repeat modes (see API doc update for details): `.mode(C.R_*)`, `.once()`, `.stay()`, `.loop()`, `.bounce()`.

Sandbox example (12sec):

return b().band([0.5, 20]).add(
b().band([0.5, 19]).add(
b('blue-rect').band([0, 3])
.rect([140, 25], [70, 70])
.fill('#009')
.stroke('#f00', 3)
.bounce() // loop() / stay() / once()
.rotate([0, 3], [0, Math.PI / 3.5]))
.add(
b('red-rect').rect([115, 90], [60, 60])
.fill('#f00'))

.rotate([0, 10], [0, Math.PI / 4]));

Also, it is now the default mode when importing clips from tool (needs to be re-checked, I created a story in tracker for it).

**P.S.** Removed trailing spaces from `builder.js` (add `?w=1` to the github URL of the diff page to see the diff with whitespace ignored.)