Amplification
One, Effect preview
Second, the establishment of four layers, as shown in the following figure
In this tutorial, to achieve the effect in the preview through the following as statement, you need to set the coordinates to (0,0).
(1) Set the x and Y coordinates (0,0) of the circular, four times times image in this element (Mask,large) respectively. As shown in figure:
(2) Set the position coordinates of the size two pictures on the scene (0,0), as shown in figure:
Three, fill in as
Algorithm Explanation:
the radius of the Mask._y=_ymouse-[mask circle and the radius of the Mask._x=_xmouse-[mask circle are used to enable the shaded circle to move with the mouse, while positioning the mouse pointer over the center point of the shaded circle mask. Principle explanation as shown in figure:
If the x,y coordinate of the circle in the component is at the center of the circle, you do not need to subtract r, and the code is modified to: mask._x=_xmouse;mask._y=_ymouse;
large._x=[1-magnification]*_xmouse and large._y=[1-magnification]*_ymouse is used to achieve large picture movement with the mouse movement, its coordinates are the mouse coordinates [1-magnification] times. Principle diagram:
[• Source files Download ·]