1.05 Elves
One, the sprite diagram created three kinds of theory 5 implementations 1, create direct creation Ccsprite::create
2. Createwithtexture creation Ccsprite::createwithtexture (Texture) //Need cctexture2d* Create Cctexture2d
cctexture2d* texture = new cctexture2d (); Texture->autorelease (); Texture->initwithimage (image); NeedCcimage
Create Ccimage
ccimage* image = new Ccimage (); Image->initwithimagefile ("Sprite/plant.png");
3. Createwithtexture CreationCcsprite::createwithtexture (Texture) //Need cctexture2d*
Create Cctexture2d
Cctexturecache::sharedtexturecache ()->addimage ("Sprite/bullet.png");//memory optimization, texture this direct return cctexture2d
4.Sharedspriteframecache ()->addspriteframeswithfile
Ccsprite::createwithspriteframe (ccspriteframe*);
Create Ccspriteframe
ccspriteframe* SF = Ccspriteframecache::sharedspriteframecache () >spriteframebyname ("Z_1_attack_07.png");
5.ccspriteframe::createccspriteframe::create ("Sprite/p_1_01.png", Ccrectmake (0, 0, +));
From for notes (Wiz)
1.05 Elves