mudcube/Event.js

Angle is supposed to be limited?

Closed this issue · 3 comments

All I get are these angles when swipping: 0, 90, 180, 270
Is this intentional?

Yup, if you would like other angles you can set the "snap" attribute when calling "swipe". This would look like this:

Event.proxy.swipe({
snap: 45,
listener: function() {},
target: targetElement,
});

This would result in the angles being returned to be 0, 45, 90, 135, 180, and so on.

Change snap to 1 to get values 1, 2, 3, 4, 5, 6, 7 and so on.

Snap defines the degrees to "snap" to.

You can also call like this:

Event.add(targetElement, "swipe", function() {}, { snap: 45 });

Ahh, bootyfull!