Five mobile game development artifact cocos2d-x editor texture (TexturePacker)

Source: Internet
Author: User

Game image resources need to be packaged, this chapter I will introduce the cocos2d-x editor Paster (TexturePacker );

The principle of textures is to combine a small image set. If an image is large (such as a background resource), it must be placed separately.

In this section, I will summarize the main knowledge points through a project called snow.


First, create a New project in File-New project and set the programming prompt;




Select Resources, right-click, for example, select TexturePacker and name it to create




Because the background image is very large, we put it separately in Resources, "m_bg_main.jpg", click the green plus sign, select all the prepared images, pay attention to the size of the entire packer, and control the size according to your own situation;







After the successful, the first Resource Merge (click the minus sign), cocos2d-x editor has some deficiencies, can not automatically refresh in real time, need to merge or need to close the entire interface, and then open the refresh, we will improve in the future. We can see that we have downloaded the image, the snow_packer.plishfile, The snow_packer.png file, and a toolbar on the left that supports preview, dragging it to the bottom;




Select an image, right-click Add Sprite, and then click layer in the Compont Tree to put sprite under the layer. If real-time update is not available, merge and open the layer to see that a sprite is added to adjust sprite parameters;





Configure the debugging button as instructed. The running effect is as follows:

: Http://www.kuaipan.cn/file/id_25348935635744397.htm? Source = 1


Next article I will introduce the scenario jump author of cocos2d-x editor (Li yuanyou)

Source: cocos2d-x editor



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.