Copy link to clipboard
Copied
I need to create a zoom in and zoom out button in addition to a play, stop and pause button for an animation created in Animate canvas. The play, stop and pause buttons are fine, but the zoom buttons are presenting a challenge. The zoom has to occur on the whole canvas, not just an image. Can anyone direct me to a tutorial that might help?
I assume you want to zoom around the Center point. Here's to code to achieve that:
this.zoomBtn.addEventListener("click", clickHandler);
exportRoot.x = exportRoot.regX = lib.properties.width/2;
exportRoot.y = exportRoot.regY = lib.properties.height/2;
function clickHandler(e) {
exportRoot.scaleX *= 1.2;
exportRoot.scaleY *= 1.2;
}
Copy link to clipboard
Copied
I assume you want to zoom around the Center point. Here's to code to achieve that:
this.zoomBtn.addEventListener("click", clickHandler);
exportRoot.x = exportRoot.regX = lib.properties.width/2;
exportRoot.y = exportRoot.regY = lib.properties.height/2;
function clickHandler(e) {
exportRoot.scaleX *= 1.2;
exportRoot.scaleY *= 1.2;
}
Copy link to clipboard
Copied
Thank you so much for your time, it is really appreciated!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now