Animatron/player — pull request #83 by shamansir (2013-04-06 00:13:13+00:00)
Title: Improving sprites

Among with ( 5e319ce...9b64a5c ], these commits introduce basic sprites support (not very tested for the moment). (with proper caching, however)

Example is:

b().sprite([0, 0], './res/sprite_sample.png', [144, 59])
.animate(5, [0, 30, 2], 10);

Which means:

Place all frames you will get from `sprite_sample.png` at `[0, 0]` position, where a tile has a size of `[144, 59]`, then immediately start animating it from global time of `0`, from frame `0` to frame `30` with a step of `2` and FPS of `10`.

`animate` may be called from inside any modifier, getting local time, and/or may be splitted into `.switch([0, 30, 2], 110).....run(5)`.

Actually there is an internal possibility to define custom "frame selector" ( _f(t) → n_ ) and/or "frame size selector" ( _f(n) → [x, y, w, h]_ ) functions which allows to enable switching to frame groups by names and/or keep different-sized tiles in one frame in future.