Cocos2d-x Study Notes (2)

Source: Internet
Author: User
Basic knowledge of Cocos2d-x: game flow control, Scene, layer, Genie 1, Scene and flow control Scene (Scene): relatively unchanged content of the element set called Flow Control (flowcontrol ): the game switching process between scenes is called Process Control in the Cocos2d-x, the realization of the scene is CCScene. 2. layer-by-layer subordinate scenarios

Basic knowledge of Cocos2d-x: game flow control, Scene, layer, Genie 1, Scene and flow control Scene (Scene): relatively unchanged content of the element set called flow control (flow control ): the game switching process between scenes is called Process Control in the Cocos2d-x, the realization of the scene is CCScene. 2. The layer belongs to the scenario

Basic knowledge of Cocos2d-x: Game process control, scene, layer, genie

1. scenario and Process Control

Scene: a set of elements whose content is relatively unchanged is called a Scene.

Flow control: process control refers to the process of switching between scenarios.

In Cocos2d-x, the implementation of the scenario is CCScene.

2. Layer

The layer belongs to the game elements under the scenario. A complex scenario involves multiple previous scenes, and a layer displays some visual elements.

The implementation of the layer is CCLayer.

3. Genie

Layers and scenes are containers of other game elements. If you don't want them to add visible game elements, they are transparent. Different from the layer and scenario, the genie belongs to the layer and is a visible image in the scenario.

The essence of implementation in Cocos2d-x is CCSprite

4. nodes and rendering tree

Node: each element in the graph is called a node.

Rendering tree: the relational graph. The Relational Graph essentially specifies the plotting method of the elements. The rendering process is the process of traversing the rendering tree.

5. In the Cocos2d-x, the action is implemented by the CCAction class, the continuous action class CCActionInterval and the instantaneous action class CCActionInstant derived from the CCAction class. All actions take one of the above two classes. You can create multiple frames in the Cocos2d-x to create the Frame Animation Sequence CCAnimation, and create the Frame Animation Sequence of 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.