Animatron/player — pull request #105 by shamansir (2013-07-23 15:11:04+00:00)
Title: Base state & Pivot

A Base state & Pivot implementation, though not all tests are completed (incompleted ones are disabled).

Ability to change pivot:

b().pvt([0, 0.5]);

Or:

b().pvt(C.R_ML); // ML means Middle-Left, other ones are Top-Left, Top-Center, Top-Right, Middle-Center, Middle-Right, Bottom-Left, Bottom-Center and Bottom-Right

Pivot is defined relatively to the object dimensions, so pivot `[ 0.5, 0.5 ]` for a circle with diameter `60` means that pivot will be placed in the point of `[30, 30]`. If the shape allows to change dimensions live, then pivot should be properly recalculated. Default pivot is `[0.5, 0.5]`.

Changing base state:

* `b().move([x, y])` or `b().pos([x, y])` — change base position of an object
* `b().size([sx, sy])` or `b().resize([sx, sy])` or `b().proportions([sx, sy])` or `b().zoom(value)`— change base scale of an object
* `b().angle(value)` or `b().slope(value)` or `b().turn(value)` — change base angle of an object
* `b().opacity(value)` — change base alpha of an object

*Warning*: `b().path(pt, description)` now also accepts point as a first argument, as all of the shapes, not the second one.
*Warning*: `b().reg(pt)` method was removed in favor of `pvt()`

Use `b().npath(pt, description)` to create normalized path (all points will be repositioned to make it centered around `[0, 0]`).