Cocos2d_x + lua [2] ------ use of TexturePacker texture packer

Source: Internet
Author: User

Advantages of TexturePacke:
1. Memory problems. The width and height of OpenGL textures and the memory used will automatically expand to the Npower of 2. For example, 257*257 will be used for 512*512, and mobile phone memory is a rare resource,
2. In terms of rendering speed, we should try to reduce the texture switching during rendering. If we do not pack the image, the texture rendering efficiency will be reduced once every image is switched. In order to increase the loading speed, splice multiple small images into a large image, load them at a time, and reduce I/O

 

 


[Cpp]
Data Format: the Format of the engine supported by the Export
Data File: export File path (for example, image. plist)
Texture Format: Texture Format
Image format: Image pixel format
Dithering: Jitter, NearestNeighbour by default
Usage: www.2cto.com

[Cpp]
Cache = CCSpriteFrameCache: sharedSpriteFrameCache ()
Cache: addSpriteFramesWithFile ("resource/tilemap/test/image. plist", "resource/tilemap/test/image.png ");
Sprite = CCSprite: spriteWithSpriteFrameName ("2.jpg ")

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.