How can I add pan and zoom controls to a Processing.js canvas?
I can draw sh开发者_StackOverflowapes on a canvas. Now I'd like to let users pan and zoom in and out using keyboard controls.
You could use variable to keep track of user feedback for zoom and pan, which you use as arguments to the translate()
(pan) and scale()
(zoom) functions.
It might help to have a look how Proessing.js fits with js/html/css.
HTH
精彩评论