Cocos2dx layer genie, as well as Genie animation and action

Source: Internet
Author: User

  • Layer genie

     

  • The genie is not necessarily static. Generally, a genie can change constantly, including moving, rotating, scaling, deformation, appearance and disappearance, and animation effects (similar to gif animation. The genie are combined according to the hierarchy and interact with players to form a complete game.
    1.  
    • From the drawing point of view, the image is drawn from top to bottom. To draw a scenario, you need to draw layers in the scenario. To draw a layer, You need to draw the genie in the layer. Therefore, the graph essentially arranges the way the elements are painted. Each element in the graph is called a node, and the graph is called a rendering tree ). The rendering process is the process of traversing the rendering tree.
      • Action and animation
        • Action acts on game elements to make them move. Common actions include moving, rotating, blinking, and disappearing. Actions are divided into continuous actions and transient actions. continuous actions are completed continuously within a period of time, and transient actions are completed instantly. To make the game picture move, we will create a series of actions as needed and apply them to the game elements. In the Cocos2d-x, actions are implemented by the ccaction class, And the ccaction class is derived from the continuous action class ccaction interval and instantaneous response class ccactioninstant. All actions are derived from one of the above two classes.
          • Animation is a special continuous action. It can only be applied to the genie to achieve the frame animation effect. Like a film, a frame animation is formed by switching between multiple static images. A static image is called a frame. The sequence of frames represents an animation effect. As shown in Figure 2-6, the fish swing in fishing talents is composed of frame animations. While swinging, the fish are still swimming in the layers of the fish, which is extremely real.
            • In the Cocos2d-x, we can use multiple frames to create a frame animation sequence (ccanimation) and use a frame animation sequence to create a frame animation (ccanimate) that can act on the genie ).
             

 

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.