The effect of our Demo is to click the screen to change the weapon. character dress-up should be a common requirement in the game, so write this Demo to share it with the people who need it. i. We directly add code in the HelloCpp project of the COCOS2D-X. we add the following code to the initialization: [cpp] CCSize szWin = CCDirector ctor: sharedDirector ()-> getVisibleSize (); CCArmatureDataManager: Alert ()-> addArmatureFileInfo ("knight.png ", "knight. plist "," knight. xml "); // load the skeleton animation file CCArmatureDataManager: sharedArmatureDataManager ()-> addArmatureFileInfo (" weapon.png "," weapon. plist "," weapon. xml "); // load the skeleton animation file setTouchEnabled (true); // enable the touch screen response pArmature = CCArmature: create (" Knight_f/Knight "); pArmature-> getAnimation () -> playByIndex (0); // play the first action pArmature-> setPosition (ccp (szWin. width/2-100, szWin. height/2); pArmature-> setScale (1.5f); this-> addChild (pArmature); std: string sWeaponName [] = {"weapon_f-sword.png", "weapon_f-sword2.png ", "weapon_f-sword3.png", "weapon_f-sword4.png", "weapon_f-sword5.png"}; CCSpriteDisplayData sprDisplayData; for (int I = 0; I <sizeof (sWeaponName)/sizeof (sWeaponName [0]); I ++) {sprDisplayData. setParam (sWeaponName [I]. c_str (); pArmature-> getBone ("weapon")-> addDisplay (& sprDisplayData, I);} II. Since we use classes in extensions in the COCOS2D-X, therefore, you need to add the corresponding directory, corresponding header files, and lib files. ①. Choose project> Properties> Configuration Properties> VC ++ directory> include directory to add the extensions folder path.: $ (SolutionDir) \ extensions ②. Add the header file, namespace, and library files involved as follows: [cpp] # include "CCArmature/utils/CCArmatureDataManager. h "# include" CCArmature/CCArmature. h "# pragma comment (lib," libBox2d. lib ") # pragma comment (lib," libExtensions. lib ") using namespace extension; 3. register the touch screen distributor [cpp] void TestUseMutiplePicture: Pull () {CCDirector: shareddire()-> getTouchDispatcher ()-> addTargetedDelegate (this, 0, true);} 3. responds to the touch screen event to implement the update. the Code is as follows: [cpp] bool HelloWorld: ccTouchBegan (CCTouch * pTouch, CCEvent * pEvent) {static int nDisplayIndex =-1; ++ nDisplayIndex; nDisplayIndex = (nDisplayIndex) % 5; pArmature-> getBone ("weapon")-> changeDisplayByIndex (nDisplayIndex, true); return false ;}