Last active
August 12, 2017 07:46
-
-
Save j2doll/9072622ca10dddf10694822f5b001863 to your computer and use it in GitHub Desktop.
Creating and using Sprite Sheets in Cocos2D-X with Texture Packer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SScc2dx.cpp | |
// http://www.jesusbosch.com/2012/06/creating-and-using-sprite-sheets-in.html | |
_batchNode = CCSpriteBatchNode::batchNodeWithFile("gamePlayPack.pvr");this->addChild(_batchNode); | |
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("gamePlayPack.plist"); | |
_ship = CCSprite::spriteWithSpriteFrameName( "ufo.png" ); | |
CCSize winSize = CCDirector::sharedDirector()->getWinSize();_ship->setPosition( ccp(winSize.width * 0.1, winSize.height * 0.5) ); | |
_batchNode->addChild( _ship, 1 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment