android--per-frame animation

Source: Internet
Author: User

Frames-per-frame animation is a common form of animation, the principle is to use the human visual lag, in the timeline of each frame to draw different content, and then in short enough time to play, give people feel like a continuous animation .

Because frame-by-frame animation is different, this not only adds a burden to the production but also the final output of the file volume is very large, but its advantages are also obvious: frame-wise animation is very suitable for performing fine animation . For example: The character walks , speaks , the animal runs , jumps and the exquisite 3D effect and so on.

The general way to create a frame-by-box animation is to first save the footage of the exiled frame animation in the program, create a Anim folder under the res folder , and finally create an XML document under the folder, in < The animation-list.../> element adds the <item.../> element to define all the frames of the animation. The content framework for an animated XML document is as follows:

Where the android:oneshot property is used to define whether the animation loops , true, to play only once, not loop, or false to loop .

<item.../> element is used to define the contents of each picture and the duration of the picture's playback , where the android:drawable Property value specifies the content of the picture to play aandroid:duration property value that specifies the time that the picture is played . The order in which the <item...> elements appear is used to specify the order in which the pictures are played .

Android also supports creating frames-by-frame animations in code, calling animationdrawable 's addframe (drawable frame, int duration) method, similar to the <item.../> when created with the XML method.

android--per-frame animation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.