Animatron/player — pull request #33 by shamansir (2012-08-07 16:47:49+00:00)
Title: Collisions: Ability to handle Mouse Events only inside of the shape

I made this option _not_ to be default, because it uses collisions module, and I think it will not be ok if the behavior will change just when you include its source. And, as before I asked users to test `contains` by themselves, I'd rather ask them to make the change consciously now, it is better than if users will let this checks stay and perform them twice in fact.

So, to enable it, use this:

anm.M[C.MOD_COLLISIONS].mouseBound = true;

Then all mouse clicks, mouse up/downs, mouse moves & s.o. that you'll receive will happen only inside of that shape you subscribed to such event (so, if `contains` test will fail for it, you'll get no events). Also, I made `C.X_MOVER` and `C.X_MOUT` to work like expected in this case (when `mouseBound` is _on_ they mean that mouse entered inside the shape and leaved accordingly, if its _off_, the same happens for canvas).

Please remember that values in `evt.pos` are still global, but you may get local value as easy as `this.$.local(evt.pos)`!