Copy link to clipboard
Copied
I can't figure out how to bind it to the mouse wheel action. Thanks!
Are you talking about in the editor, or in your content?
In the editor you can use the mousewheel to zoom in/out by holding down Ctrl at the same time.
Copy link to clipboard
Copied
Hi.
Try something like this:
function onMouseWheel(e)
{
var delta;
if (e == window.event)
delta = -10 / window.event.wheelDeltaY;
else
delta = e.detail / 30;
YOUR_MC.scaleX -= delta;
YOUR_MC.scaleY = YOUR_MC.scaleX;
}
document.getElementById('canvas').addEventListener('mousewheel', onMouseWheel.bind(this));
document.getElementById('canvas').addEventListener('DOMMouseScroll', onMouseWheel.bind(this));
Regards,
JC
Copy link to clipboard
Copied
Are you talking about in the editor, or in your content?
In the editor you can use the mousewheel to zoom in/out by holding down Ctrl at the same time.
Copy link to clipboard
Copied
In the Editor! Thank you
Copy link to clipboard
Copied
Because someone answered the question,
So this is just a discussion.
In fact, it is better to have a certain habit.
In fact, the main you zoom will affect the line weight, resulting in poor animation effect.
Because I also do animation mainly.
Currently recommended 2 methods.
1,
the stroke size is set to fixed. Select "Zoom in with the stage small"
Then CTRL + wheel.
Or
CTRL + = and CTRL +-
Zoom in and Zoom out.
2,
Cancel "Zoom out and stage small"
And then through the ctrl+1,2,3,4 switch.
This will make the drawing line automatically thinner
In addition, if the mouse has more than one key, you can set the custom key.
General drive will have, if not, you can download the Xmouse Settings button. It is best to enlarge, shrink, pen, and so on to set the mouse button.