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