Answer the question
In order to leave comments, you need to log in
How to make scrolling for Paper.js?
I'm trying to make scrolling for Paper.js. There is a Canvas element for which the dragup and dragdown events fire. I get the event object and substitute the deltaY value as the offset for the scrollBy method.
function dragUp(event) {
paper.view.scrollBy(new paper.Point(0, event.gesture.deltaY));
}
function dragDown(event) {
paper.view.scrollBy(new paper.Point(0, event.gesture.deltaY));
}
element.on('dragup', dragUp).on('dragdown', dragDown);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question