Unroll Transition.java

Unroll’Transition makes it appear as if a rolled-up poster is placed on the bottom of the applet ana then unrolled upward, gradually revealing the next image and covering the old image. To enhance the unroll illusion, the roll gradually decreases in size as it makes its ‘way upward on the billboard.

Two instance variables are used during the creation of unroll transitions. The -Iocation variable references- pixels within the pixel arrays. It stores the current pixel that the roll first appears on. The unroll jimount array variable tells-the class how many vertical pixels the roll should move upward each frame. The most difficult part of creating each cell frame is drawing the 1’011. The only other task that needs to be completed each frame is to draw the pixels from the new image onto the space vacated by the roll from the previous frame. The roll is drawn with scan lines from the new image. The first line of the. roll is drawn with the scan line located at the Y coordinate above. the roll’s Ycoordinate on the applet. For.example, if the roll is located on line ten for a particular cell frame, then line nine of the new image will be used to draw the first line of the roll. Each subsequerit line of the roll is drawn using a line from the image located above the previous line of the new image. So, continuing the example, the second line of the roll will be drawn using line eight of the new image. , Theron is painted with its 3-D appearance by drawing each line of the roll with a slight offset to the left. Lines closer to the center of the roll arc drawn with a larger offset than hnes dose to#.thetOFand bottom. The top and bottom lines of the rolls are then shaded to make it took as if a light were above the applet. This results in the op line being” bit brighter than the rest of the roll and the bottom lino being a bit darker.

[vfb id=1]

Share This