Quality]: Cocos2d Sprite Sheets [extra

auto animation = Animation::createWithSpriteFrames(frames, 0.1f); auto animate = Animate::create(animation); player->runAction(RepeatForever::create(animate)); | Tool | Platform | Features | |------|----------|----------| | TexturePacker (recommended) | Win/Mac/Linux | GUI, cocos2d plist export, trimming, rotation | | Zwoptex | Mac | Legacy, simple | | ShoeBox | Mac | Free, batch processing | | Adobe Flash CS6 | Win/Mac | Sprite sheet export (older) |

batch->addChild(sprite1); batch->addChild(sprite2); All sprites in a SpriteBatchNode must share the same texture. 4.3 Animation from Sprite Sheet Vector<SpriteFrame*> frames; for (int i = 1; i <= 10; i++) auto frame = spritecache->getSpriteFrameByName("player_run_0" + StringUtils::toString(i) + ".png"); frames.pushBack(frame); cocos2d sprite sheets

| Method | Draw Calls | FPS | Memory (MB) | |--------|------------|-----|--------------| | Individual PNGs | 501 | 32 | 78 MB | | Sprite sheet (no batch node) | 1 | 58 | 42 MB | | Sprite sheet + SpriteBatchNode | 1 | 60 | 42 MB | auto animation = Animation::createWithSpriteFrames(frames, 0

Situs ini menggunakan cookie. Dengan terus menelusuri situs, Anda menyetujui penggunaan cookie kami.