Ccsize size = ccdirector: shareddire()-> getwinsize (); ccsprite * BG = ccsprite: Create ("helloworld.png"); BG-> setposition (CCP (size. width/2, size. height/2); // CCP ccpoint this-> addchild (BG); ccsprite * SP1 = ccsprite: Create ("icon.png "); SP1-> setposition (CCP (size. width * 0.2, size. height * 0.7); this-> addchild (SP1); ccsprite * SP2 = ccsprite: Create ("icon.png", ccrect (28,28, 29,29 )); SP2-> setposition (CCP (size. width * 0.4, size. height * 0.7); this-> addchild (SP2); cctexture2d * texture = cctexturecache: sharedtexturecache ()-> addimage ("icon.png "); // create a 2D Texture ccsprite * SP3 = ccsprite: createwithtexture (texture); SP3-> setposition (CCP (size. width * 0.6, size. height * 0.7); this-> addchild (SP3); ccsprite * SP4 = ccsprite: createwithtexture (texture, ccrect (0, 0, 40, 40 )); SP4-> setposition (CCP (size. width * 0.8, size. height * 0.7); this-> addchild (SP4); ccspriteframe * frame = ccspriteframe: Create ("icon.png", ccrect (0, 0, 57,57 )); ccsprite * SP5 = ccsprite: createwithspriteframe (FRAME); // cache frame SP5-> setposition (CCP (size. width * 0.3, size. height * 0.3); this-> addchild (SP5); SP5-> setscale (0.5f); SP5-> setrotation (30366f ); // if the value is greater than 0, the clockwise value is less than 0. SP5-> setskewx (30); // The image is skewed at the center of the image. // SP5-> setvisible (false ); // invisible // SP5-> setcolor (ccc3 (100, 0); SP5-> setopacity (255); // 0-SP5-> settexture (cctexturecache :: sharedtexturecache ()-> addimage ("closenormal.png");/* ccspriteframecache: sharedspriteframecache ()-> addspriteframeswithfile ("IMG. plist "); ccsprite * SP6 = ccsprite: createwithspriteframename (" icon.png "); // cache frame SP6-> setposition (CCP (size. width * 0.7, size. height * 0.3); this-> addchild (SP6 );*/
Coco2dx genie class